1. #1
    Sencha User
    Join Date
    Jan 2014
    Posts
    1
    Vote Rating
    0
    VinceD is on a distinguished road

      0  

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

    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 :


    Code:
    var fields =  ['date', 'valeur', 'polluant']; 
    var store = Ext.create('Ext.data.JsonStore', {     
        fields:fields,     
        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 - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    5,017
    Vote Rating
    95
    Gary Schlosberg is just really nice Gary Schlosberg is just really nice Gary Schlosberg is just really nice Gary Schlosberg is just really nice

      0  

    Default


    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.


    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager:
    sheryl@sencha.com

Thread Participants: 1

Tags for this Thread