[CLOSED] Chart Legend Renderer

  1. #1

    [CLOSED] Chart Legend Renderer

    Hi

    I have a chart (bar series) which is populated using a pivot, the chart itself is dynamic and it responds to various click events on the segments in order to provide drill down functionality. In order to provide this I need to store in the model both the the ID and the Name from the database so something like this "1|Henry". In this example "Henry" is what needs to be displayed in the legend.

    For the Axis Label and the tooltips it is easy enough to split out the id and just display the label but I do not see a way of doing this for the legend as I do not see a "Legend Label Renderer".

    On the bar series I see a titles property which I could probably use but would rather just use some sort of renderer on the legend labels.

    Ta,
    D
    Last edited by fabricio.murta; Dec 22, 2016 at 2:06 PM.
  2. #2
    Hello!

    The legend does not support a renderer. Answer pulled directly from ExtJS forums regarding the ExtJS version that powered Ext.NET 2.x:
    - Add renderer in chart pie legend

    I'm afraid to make something similar to Ext.NET 2 you will need to extend the chart legends to support such behavior.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    On a second thought, I gave the forums a search and maybe this would help you with the custom legends. Not really sure, but worth a try!
    - Chart Legend Names
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Ended up using the titles which works, although would definitely prefer a renderer.

    
            private void DoLegendTitles(BarSeries bseries, List<string> cols)
            {
                string[] splicollist = new string[cols.Count];    
                int count = 0;
                foreach (string scol in cols)
                {
                    string[] ssplitcol = scol.Split('|');
                    splicollist[count] = ssplitcol[1];
                    count++;       
                }
                bseries.Titles = splicollist;
            }
  5. #5
    Hi Fabricio

    Missed your 2 posts before posting my solution. Just mark as closed if there is no renderer as dynamically setting the titles property works fine.

    Thanks for responding.

    D
  6. #6
    Hello! Thanks for your feedback and for sharing the solution that works for you, I think your approach, if acceptable for you, would be the most feasible one.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 2
    Last Post: Jul 23, 2014, 1:02 PM
  2. Ext.Net Chart Legend Position
    By infotex in forum 2.x Help
    Replies: 0
    Last Post: Apr 16, 2013, 1:41 PM
  3. Chart Legend Name
    By sallama in forum 2.x Help
    Replies: 1
    Last Post: Mar 29, 2013, 11:30 PM
  4. chart legend
    By koma in forum 2.x Help
    Replies: 0
    Last Post: Sep 12, 2012, 3:09 AM
  5. Replies: 2
    Last Post: Aug 13, 2012, 2:12 PM

Posting Permissions