How to show only one label when multiple line series have same data point. (Intersection of lines)

Page 1 of 2 12 LastLast
  1. #1

    How to show only one label when multiple line series have same data point. (Intersection of lines)

    I am creating line chart with multiple line series. I need to implement following functionalities

    1. Need to show only one label where multiple line series intersect each other.

    2. Need to show only one marker for that data point where lines intersect.

    Also, record parameter of renderer function of line series does not point to actual record for that marker. It always start from first record of store. I have few null values in columns so I want that record parameter should point to the actual associated data, however markers are drawn correctly.
  2. #2
    Hi @Pradip,

    Welcome to the Ext.NET forums!

    Please provide a test case to reproduce the issues.
  3. #3
    Quote Originally Posted by Pradip View Post
    I am creating line chart with multiple line series. I need to implement following functionalities

    1. Need to show only one label where multiple line series intersect each other.

    2. Need to show only one marker for that data point where lines intersect.

    Also, record parameter of renderer function of line series does not point to actual record for that marker. It always start from first record of store. I have few null values in columns so I want that record parameter should point to the actual associated data, however markers are drawn correctly.
    Thanks @Daniil

    I have data as follows, following data is for single country only, I will have such data for multiple countries.
    EffectiveStartDate Price NotApprovedPrice IsApproved Country
    02/28/14 12.45 TRUE SPAIN
    03/02/14 10.2 TRUE SPAIN
    03/04/14 12.2 TRUE SPAIN
    03/08/14 15.78 TRUE SPAIN
    03/04/14 12.2 FALSE SPAIN
    03/07/14 11.42 FALSE SPAIN
    03/08/14 15.78 FALSE SPAIN
    03/09/14 12.28 FALSE SPAIN

    I am able to draw chart like the one can be seen in attached image.

    ISSUES

    1. I need countries names too in the X-axis with dates. How to implement that?

    2. "NotApprovedPrice" line series is dotted line, but in image it comes as solid line.

    3. There are two labels with text "5-Mar-2014 : $12.2" as both line series have same data point, it looks as single because they overlapped on each other. How can I determine whether two or more line series have same data point?

    4. I have written a function as follows to give red color to particular marker:

    var makeCurrentPriceMarkerRed = function (lineSeries, sprite, attributes, store, index, record) {
            if (lineSeries.markerGroup.contains(sprite)) {
                var values = sprite.value.split(',');
                var esDate = new Date(parseInt(values[0].substr(1, values[0].length - 1)));
                if (Ext.util.Format.date(esDate, 'd-M-Y') == '05-Mar-2014') {
                    attributes.stroke = 'red';
                    attributes.radius = '0';
                }
            }
            return attributes;
        }
    Above function has been called on line series renderer function as follows:
    .Renderer(r => r.Handler = "return makeCurrentPriceMarkerRed(this,sprite,attributes,store,index,record);")
    Here, record parameter always points starting from first record to number of markers in particular line series. e.g. From above data from record no. 5 to 8 is of second line series, when renderer handler called "record" parameter contains data of 1st record of store instead of line series 1st record i.e. record no. 5 of store.

    Any solution for above?
    Attached Thumbnails Click image for larger version. 

Name:	chart-7321ab763127ad254f7961dd21041b76.png 
Views:	47 
Size:	30.6 KB 
ID:	7881  
    Last edited by Daniil; Mar 07, 2014 at 11:07 AM. Reason: Please use [CODE] tags
  4. #4
    Let's go step by step.

    Quote Originally Posted by Pradip View Post
    I am able to draw chart like the one can be seen in attached image.
    Providing us with a sample is appreciated. We need something to test with.

    Quote Originally Posted by Pradip View Post
    1. I need countries names too in the X-axis with dates. How to implement that?
    This might be helpful.
    http://docs.sencha.com/extjs/4.2.1/#...xt.chart.Label
  5. #5
    Quote Originally Posted by Daniil View Post
    Let's go step by step.



    Providing us with a sample is appreciated. We need something to test with.



    This might be helpful.
    http://docs.sencha.com/extjs/4.2.1/#...xt.chart.Label
    Hi @Daniil

    Thanks for the link. I checked it but not able to find solution by using that link.

    I need countries in legends, each country will have 2 line series of same color and multiple countries will have unique color. Can you please give me a small sample for this scenario?

    Also, with only one field can we draw two line series? There will be one boolean column to differentiate between two line series. e.g. The data table I have posted in previous post in that I have field "Price" and "IsApproved" by using these two fields I want to draw two line series. I do not want to use"NotApprovePrice" field for second line series.
    Last edited by Pradip; Mar 10, 2014 at 4:24 AM.
  6. #6
    This is now actual.

    Quote Originally Posted by Daniil View Post
    Quote Originally Posted by Pradip View Post
    I am able to draw chart like the one can be seen in attached image.
    Providing us with a sample is appreciated. We need something to test with.
  7. #7
    Can you please provide solution for the following issues?

    2. Need to show only one marker for that data point where lines intersect.

    Also, record parameter of renderer function of line series does not point to actual record for that marker. It always start from first record of store. I have few null values in columns so I want that record parameter should point to the actual associated data, however markers are drawn correctly.
  8. #8
    Can anyone provide me the solution?
  9. #9
    Can anyone provide me the solution?

    I need a solution for "record" parameter, why it contains wrong data?
  10. #10
    Please re-read the post #6.
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Fill between two line series
    By jchau in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 20, 2014, 1:51 PM
  2. Replies: 2
    Last Post: Nov 07, 2013, 1:03 PM
  3. [CLOSED] Line chart- Working with multiple lines
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 10
    Last Post: Jul 29, 2013, 4:09 AM
  4. [OPEN] [#40] How can show the labels over each point of the LineSeries?
    By tactime10 in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 17, 2012, 12:43 AM
  5. Replies: 3
    Last Post: Jul 13, 2012, 10:28 AM

Posting Permissions