[CLOSED] CartesianChart Legend Titles

  1. #1

    [CLOSED] CartesianChart Legend Titles

    Is there a way to put a title on the legend? It doesn't look like ChartLegend has a title property. For example, this chart has the text "LEGEND TITLE" above the legend, which I would like to do in Ext.Net. This seems like a pretty basic (and important) feature for presenting data graphically.

    Click image for larger version. 

Name:	Capture4.png 
Views:	88 
Size:	4.9 KB 
ID:	24048
    Last edited by fabricio.murta; Jul 01, 2015 at 7:09 PM. Reason: [CLOSED]
  2. #2
    Hi MrProtonYo,

    Interesting question. Looking at your picture, it seems a pretty expected feature but, when I search around, I don't really see both people using an specific 'title' to the legend itself nor asking for that feature. Started looking in Ext.NET and ExtJS discussions, then jumped to general searching for charts, and usually I don't see a title for the 'legends' box.

    But you can achieve this in a couple manners, among them, just by setting a value to the Html attribute on the LegendConfig element.

    Another way would be to use a <ext:TextSprite> and position a label representing the legend's title right above it.

    I hope this helps.
    Fabrício Murta
    Developer & Support Expert
  3. #3

    Fixed

    Using the Html attribute of the LegendConfig element worked. I could probably spend some more time formatting it nicely, but it definitely works well for now. I just set the Html to be the title I want, with a line break at the end (otherwise the legend is shifted).

            let chartLegend = new ChartLegend()
            chartLegend.Html <- barChartData.Fill.Title + "<br>"
            chartLegend.Dock <- Dock.Right
            chart.LegendConfig <- chartLegend
  4. #4
    Glad it helped you build your chart the way you want! Thank you again for sharing the snippet of your solution.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Questions about CartesianChart objects
    By MrProtonYo in forum 3.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 01, 2015, 7:06 PM
  2. [CLOSED] CartesianChart Background Color
    By MrProtonYo in forum 3.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 01, 2015, 7:01 PM
  3. How I can change the titles of the axes of a Chart
    By inlinerider in forum 2.x Help
    Replies: 2
    Last Post: Nov 21, 2014, 8:37 PM
  4. [CLOSED] [#47] [MVC 3 Razor] Tabpanel Titles
    By dheeraj_us in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 30, 2013, 3:56 PM
  5. [CLOSED] Tab titles ellipsis not working - here's a CSS fix
    By anup in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Apr 12, 2011, 3:48 PM

Posting Permissions