Results 1 to 8 of 8

Thread: Need realistic chart example

  1. #1
    Sencha User
    Join Date
    Jun 2013
    Posts
    4
    Vote Rating
    0
      0  

    Default Need realistic chart example

    I am using ExtJs 4.2.1. All the charts examples in the docs are unrealistic in tha they render directly to a window insider an Ext.onReady() call but no application is like that.

    I have a custom panel that goes like this:
    Code:
    Ext.define('MyPanel', {
        extend: 'Ext.panel.Panel',
        requires: [ 'Ext.chart.*' ],
        layout: 'fit',
        statics: {
            createChartData:  function() { ... },
            createChartStore: function() { ... },
            createChart:      function(store) { ... }
        },
        initComponent: function() {
            this.chartStore = MyPanel.createChartStore();
            this.items = MyPanel.createChart(this.chartStore);
            this.callParent(arguments);
        },
    where the statics are lifted verbatim from the examples/charts/Area.js and examples/example-data.js code. When I try to run that I get scores and scores of
    Code:
    Error: Problem parsing d="C0,0,0,0,0,0"
    or some longer expression in Svg.js. The chart is rendered but the errors are not trivial because I also get lots of:
    Code:
    Uncaught TypeError: undefined is not a function
    in Ext.define.getPoint when moving the mouse over the panel tool buttons, errors I don't get if I omit the chart. The example itself works fine. This is with Chrome. In FF I don't get either of these errors but instead I get lots of
    Code:
    TypeError: Ext.util.Point is not a constructor
    when mousing over the chart. Does anyone know what is going on?
    Last edited by oliver1971; 27 Jun 2013 at 7:50 PM. Reason: typo

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505
    Vote Rating
    255
      0  

    Default

    Are you looking to create a real-world application where the chart is embedded in a panel and the data is pulled down from a server/DB?

  3. #3
    Sencha User
    Join Date
    Jun 2013
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Yes, exactly.

  4. #4
    Sencha User
    Join Date
    Jul 2013
    Posts
    1
    Vote Rating
    0
      0  

    Default

    that's right
    Internet Marketing Egypt | Web Development Egypt | Web Hosting Egypt |<a href="http://netedges.com/">Internet Marketing Egypt</a>

  5. #5
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505
    Vote Rating
    255
      0  

    Default

    I would think that the examples give a good jumping off point, though their stores aren't necessarily what you're looking for - but you can borrow the store config from another example to show how it's constructed.

    http://docs.sencha.com/extjs/4.2.1/e...charts/Area.js
    has the basic structure of creating a chart and inserting it as a child of another panel / window.

    http://docs.sencha.com/extjs/4.2.1/e...iter/writer.js
    has an example of how to set up a store with different read/write urls.

    And when it comes to putting it all together into an app I'd recommend checking out these guides:
    http://docs.sencha.com/extjs/4.2.1/#!/guide/mvc_pt1
    http://docs.sencha.com/extjs/4.2.1/#!/guide/mvc_pt2
    http://docs.sencha.com/extjs/4.2.1/#!/guide/mvc_pt3

  6. #6
    Sencha User
    Join Date
    Jun 2013
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Before I reply can somebody tell me how to stop the forum software from throwing away my blank lines and mashing everything into a single paragraph? Thx.

  7. #7
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505
    Vote Rating
    255
      0  

    Default

    If you're having trouble copying / pasting code from your editor you might try posting it to this site:
    http://jsbeautifier.org/
    and running it through their formatting script before pasting to the forum.

  8. #8
    Sencha User
    Join Date
    Jun 2013
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Have you looked at my first posting? I know how to include code in this forum. My problem is that when I try to post plain text but in several paragraphs the forum software mashes all the paragraphs into a single blob, i.e., it throws away the blank lines. I do not see in the BB code any equivalent of the HTML
    either.

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
  •