[CLOSED] Chart Legend Names

  1. #1

    [CLOSED] Chart Legend Names

    I have several charts working now based on Ext.Net examples, but am confused on one thing. Your ChartData has fields Data1, Data2, ...

    I would like to have my Legend show years (2011, 2010), but am having issues. Do you show me a small example were the legend names can be shown in years (2011, 2010) instead of (Data1, Data2).
    Last edited by Daniil; Nov 05, 2012 at 3:43 PM. Reason: [CLOSED]
  2. #2
    Hi Chris,

    You can use a Titles property.
    Titles="2011, 2012, 2013"
    This property is to set up an array for the "title" config option.
    http://docs.sencha.com/ext-js/4-1/#!...ries-cfg-title
    Last edited by Daniil; Nov 05, 2012 at 6:12 AM.
  3. #3
    Got it. Please close the thread.

    Not a big deal but I defined my Tip renderer to be:

    cSeries.Tips.Renderer.Handler =
          "this.setTitle('Year ' +
                          item.yField.substr(1, 4) + ' - ' +
                          String(item.value[1]));";
    I set my Column Series:

    cSeries.YField =  "Y2012,Y2011,Y2010";
    cSeries.Titles = "2012,2011,2010";
    During the renderer I substr the item.yfield to remove the first character because I can't determine the index of the item.series.title[?] to use during the renderer. I guess the substr will have to do.
  4. #4
    Hope this helps.
    <Renderer Handler="var index = item.series.yField.indexOf(item.storeField);
                       this.setTitle(item.series.title[index]);" />
  5. #5
    Quote Originally Posted by Daniil View Post
    Hope this helps.
    <Renderer Handler="var index = item.series.yField.indexOf(item.storeField);
                       this.setTitle(item.series.title[index]);" />
    There is no item.storeField, but I changed it to item.yField at it worked perfectly for Column Series.

    <Renderer Handler="var index = item.series.yField.indexOf(item.yField);
                       this.setTitle(item.series.title[index]);" />
    Please close the thread.
  6. #6
    I was testing with an AreaSeries.

    Apologize, mMissed the fact that you use a ColumnSeries.
  7. #7
    Not a problem, it pointed me in the right direction. Please close the thread.

Similar Threads

  1. [OPEN] [#77] Chart legend problems with large amount of series
    By MWM2Dev in forum 2.x Legacy Premium Help
    Replies: 14
    Last Post: Dec 21, 2012, 4:23 AM
  2. chart legend
    By koma in forum 2.x Help
    Replies: 0
    Last Post: Sep 12, 2012, 3:09 AM
  3. Replies: 2
    Last Post: Aug 13, 2012, 2:12 PM
  4. Replies: 1
    Last Post: Jun 02, 2012, 7:12 AM
  5. Replies: 0
    Last Post: Apr 05, 2011, 4:18 AM

Posting Permissions