Results 1 to 3 of 3

Thread: Line Chart not taking repeating points

  1. #1

    Default Line Chart not taking repeating points

    I have a line chart and to code looks like this.

    Ext.onReady(function(){
    var store = new Ext.data.JsonStore({
    idProperty: 'val',
    fields: ['area', 'yield'],
    data: [
    {area:10, yield: 10},
    {area:20, yield: 50},
    {area:30, yield: 30},
    {area:30, yield: 20}
    ]
    });

    new Ext.Panel({
    width: 600,
    height: 400,
    renderTo: 'container',
    title: 'area vs yield',
    items:
    {
    xtype: 'linechart',
    store: store,
    xField: 'area',
    xAxis: new Ext.chart.NumericAxis
    ({
    stackingEnabled: true,
    labelRenderer : Ext.util.Format.numberRenderer('0,0')

    }),
    yAxis: new Ext.chart.NumericAxis
    ({
    stackingEnabled: true,
    labelRenderer : Ext.util.Format.numberRenderer('0,0')

    }),

    series: [
    {
    yField: 'yield',

    displayName: 'Yield',
    style:{connectPoints: true}
    }
    ]
    }
    });
    });

    If you notice in the data I am feeding to the chart I have kept the same value for the column 'area' in the last two records(marked them in red). When I repeat the data points particularly for the xField I see the chart component taking only the last data point and it is ignoring the previous data points.

    Can anyone help me on this. I don't think this is an expected behavior.

    Thanks
    Mohar

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    How else would you have it behave?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3

    Default

    I am expecting two points to show one on top of the other for the xField val 30.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •