Hybrid View

  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    1
    Vote Rating
    0
    jewes is on a distinguished road

      0  

    Default Unanswered: Dynamically generate multiple series in line chart using the datastore data.

    Unanswered: Dynamically generate multiple series in line chart using the datastore data.


    Please help me!!!

    I need to create a line chart containing a unknown number of series based on the data in the data store.
    My data model and store looks like this:
    Code:
    var chartDataModel =
        Ext.define
        (
            'chartDataModel',
            {
                extend: 'Ext.data.Model',
                fields:
                [
                    {
                        name: 'productName',
                        mapping: 'ProductName',
                        type: 'string'
                    },
                    {
                        name: 'entryCount',
                        mapping: 'EntryCount',
                        type: 'int'
                    },
                    {
                        name: 'createdShort',
                        mapping: 'CreatedShort',
                        type: 'string'
    
    
                    }
                ]
            }
        );
    
    
    // This create the Store. It use the Log Data Model 
    var chartDataStore =
        Ext.create
        (
            'Ext.data.Store',
            {
                id: 'chartDataStore',
                model: 'chartDataModel',
                proxy:
                {
                    type: 'ajax',
                    url: '/Helpers/GetLogAggregatesForDeveloper.ashx',
                    reader:
                    {
                        root: 'LogAggregates',
                        reader: 'array'
                    }
                },
                listeners: {
    
    
                    load: {
                        fn: function () {
    
    
                        }
                    }
                }
    
    
            }
        );
    
    
    chartDataStore.load();
    The store will contain something like this:
    Capture.PNG

    What I would like is to generate a line(serie) for every distinct 'productName'. The X-Axis should be represented by 'createdShort' and the Y-Axis by 'entryCount'.

    Hope someone out/in there can help me.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,882
    Answers
    653
    Vote Rating
    439
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    The following demo should show you how to setup your store and create unique line series:
    http://dev.sencha.com/deploy/ext-4.1...charts/Line.js

    Scott.

Thread Participants: 1

Tags for this Thread