Home Forums WPF controls Xceed Toolkit Plus for WPF Axis names in the legend in xctk:Chart displayed twice

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • sonja
    Participant
    Post count: 7
    #44592 |

    Hi,
    when I use xctk:Chart in the legend the axis names are displayed twice: once on the top and once next to the circle filled with axis color. I need this name to be displayed only once, next to the circle with axis color. Please advice

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    The text next to the colored circle is the series Title and the text on top of the colored circle is the legendItem text:
    -the DataPoint label when ShowPointsInLegend is true
    -the series Title when ShowPointsInLegend is false.

    In your case, ShowPointsInLegend is false, so the series title is replicated.

    To remove the one on top of the colored circle, modify the legend in order to set an empty DataTemplate for Legend.DefaultSeriesTitleDataTemplate property :
    In resources :
    <DataTemplate x:Key=”MyLegendSeriesTitleDataTemplate” />

    in chart :
    <xctk:Chart.Legend>
    <xctk:Legend DefaultSeriesTitleDataTemplate=”{StaticResource MyLegendSeriesTitleDataTemplate}”/>
    </xctk:Chart.Legend>

    sonja
    Participant
    Post count: 7

    Hi Fawzi,
    Thank you very much for your answer, it works

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.