Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Toolkit Chart Template Modify
2 replies. Latest Post by baskarg83 on November 9, 2009.
(0)
mgreenwa...
Member
0 points
1 Posts
11-04-2009 6:38 PM |
I have opened the source of the October Toolkit
Added the Project
Controls.DataVisualization.Toolkit to my solution
Opened up Chart.Xaml
removed the
<datavis:Legend x:Name="Legend" Title="TITLE" Style="{TemplateBinding LegendStyle}" Grid.Column="1"/>
Added a Project Reference to my Silverlgiht application
Added this to my MainPage.xaml
<Charting:Chart x:Name="Count" Width="600"> <Charting:ColumnSeries Title="Field Frequency" IndependentValueBinding="{Binding Path=Field}" DependentValueBinding="{Binding Path=Count}" /> </Charting:Chart>
And then built my project and the Legend still says: Series 1 and shows a legend
Mog Lian...
All-Star
16023 points
1,553 Posts
11-09-2009 12:36 AM |
Hi,
I understand that you want to hide legend in chart, then you could apply style to legend by Chart.LegendStyle property to hide it.
Here is sample
<Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources> <Style TargetType="datavis:Legend" x:Key="ls1"> <Setter Property="Opacity" Value="0" /> </Style> </Grid.Resources> <charting:Chart LegendStyle="{StaticResource ls1}"/> </Grid>
Thanks,
baskarg83
414 points
128 Posts
11-09-2009 12:53 AM |
hey if you want to remove the Legend from you chart,
try this code
<charting:Chart.LegendStyle> <Style TargetType="Control"> <Setter Property="Width" Value="0"/> <Setter Property="Height" Value="0"/> </Style> </charting:Chart.LegendStyle>
if it is useful "please mark as Answer"