Results 1 to 2 of 2

Thread: Can't make a line chart working well and can't find examples on the net

  1. #1
    Sencha User
    Join Date
    Jan 2014
    Vote Rating

    Default Can't make a line chart working well and can't find examples on the net

    Ok, I've checked every chart examples out of Ext docs, and none fits my needs.
    Why ? Because I have a specific store. I'll explain myself.

    Let's assume I have this store :

    var fields =  ['date', 'valeur', 'polluant']; 
    var store = Ext.create('', {     
        data: [{         'date': '15/12/13',         'value': 01,         'pollutant': 'SO2',     },
                  {         'date': '16/12/13',         'value': 18,         'pollutant': 'SO2',     }, 
                  {          'date': '15/12/13',         'value': 12,         'pollutant': 'O3',     },    
                  {         'date': '16/12/13',         'value': 23,         'pollutant': 'O3',     },] 

    This is the way my store is populated, after receiving a JSON POST.
    As you can see, there is several time the same value in 'date', but different 'pollutant' then.
    After that, I need to create a line chart.

    The X axis will be the date
    The Y axis will be the value
    The series will be the value BASED on the 'pollutant' they are linked to
    And the problem, is that I don't know how to make this work.

    According to what I wanna do, if I manage to suceed, I should have a chart with two series (a and b), the a one with "1" value for the "15/12/2013" axis and "12" for the b series on the same axis value, and so on.

    I could provide come code for the chart configuration, but it really leads me nowhere for the moment, so I'm seeking help here !
    Let me know if it's not clear enough !

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Vote Rating


    I would recommend rearranging your data to have a value for each pollutant if you have access the server. I gave it a quick try and couldn't get it to work with the store set up as you have it.

Tags for this Thread

Posting Permissions

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