hello...
I used RadChart of Bar Series..
I want to display different Series Label Text Foreground Color from own's Bar Color with transparent background.
How can I solve this... please advice to me...
attached files are before and after screen.
bellow code is source
----------------------------------------------------------
<chart:RadChart Grid.Row="0"
x:Name="RadChart1"
BorderThickness="0"
ItemsSource="{Binding DFChartList}"
SeriesMappings="{Binding DFSeriesMappings2}"
LegendStyle="{StaticResource ChartLegendStyle}"
Margin="10,-7,15,0"
MinWidth="350" MinHeight="0" Height="240">
<chart:RadChart.DefaultView>
<charting:ChartDefaultView ChartLegendPosition="Bottom">
<charting:ChartDefaultView.ChartArea>
<charting:ChartArea LegendName="ChartLegend1" EnableAnimations="False" EnableTransitionAnimations="True"
TransitionControlStyle="{StaticResource TransitionControlStyle}" LabelFormatBehavior="None">
<charting:ChartArea.AxisY>
<charting:AxisY AutoRange="False" MinValue="0" MaxValue="{Binding DFMaxValue}" Step="{Binding DFStepValue}"
MinorTicksVisibility="Visible" MajorTicksVisibility="Visible" />
</charting:ChartArea.AxisY>
</charting:ChartArea>
</charting:ChartDefaultView.ChartArea>
<charting:ChartDefaultView.ChartLegend>
<charting:ChartLegend BorderThickness="0" Header="" x:Name="ChartLegend1" />
</charting:ChartDefaultView.ChartLegend>
</charting:ChartDefaultView>
</chart:RadChart.DefaultView>
</chart:RadChart>
----------------------------------------------------------
XElement rootElement = e.Result;
foreach (XElement rowEle in rootElement.Descendants("row"))
{
String strCreateDate = rowEle.Attribute("createDate") != null ? rowEle.Attribute("createDate").Value : String.Empty;
DateTime dtCreateDate = new DateTime();
DateTime.TryParse(strCreateDate, out dtCreateDate);
strCreateDate = dtCreateDate.ToString("MM/dd");
ChartM StatAPIAnalChartM = new ChartM();
StatAPIAnalChartM.CreateDate = strCreateDate;
StatAPIAnalChartM.Type = "StaticAPIanalysis";
StatAPIAnalChartM.Count = 0;
StatAPIAnalChartM.ChartColor = new SolidColorBrush(Color.FromArgb(255, 106, 228, 92));
ChartM AppContReviewChartM = new ChartM();
AppContReviewChartM.CreateDate = strCreateDate;
AppContReviewChartM.Type = "Appl.ContentReview";
AppContReviewChartM.Count = 0;
AppContReviewChartM.ChartColor = new SolidColorBrush(Color.FromArgb(255, 119, 158, 232));
ChartM DynAPIAnalChartM = new ChartM();
DynAPIAnalChartM.CreateDate = strCreateDate;
DynAPIAnalChartM.Type = "DynamicAPIanalysis";
DynAPIAnalChartM.Count = 0;
DynAPIAnalChartM.ChartColor = new SolidColorBrush(Color.FromArgb(255, 242, 84, 144));
ChartM OthersChartM = new ChartM();
OthersChartM.CreateDate = strCreateDate;
OthersChartM.Type = "Others";
OthersChartM.Count = 0;
OthersChartM.ChartColor = new SolidColorBrush(Color.FromArgb(255, 148, 0, 211));
ChartM FncTestChartM = new ChartM();
FncTestChartM.CreateDate = strCreateDate;
FncTestChartM.Type = "FunctionalTest";
FncTestChartM.Count = 0;
FncTestChartM.ChartColor = new SolidColorBrush(Color.FromArgb(255, 170, 128, 0));
.
.
.
}
this.DFChartList.Add(StatAPIAnalChartM);
this.DFChartList.Add(AppContReviewChartM);
this.DFChartList.Add(DynAPIAnalChartM);
this.DFChartList.Add(OthersChartM);
this.DFChartList.Add(FncTestChartM);
BindDFChart();
}
----------------------------------------------------------
public void BindDFChart()
{
Style itemLabelStyle1 = new Style { TargetType = typeof(SeriesItemLabel) };
itemLabelStyle1.Setters.Add(new Setter(SeriesItemLabel.ForegroundProperty, new SolidColorBrush(Color.FromArgb(255, 106, 228, 92))));
itemLabelStyle1.Setters.Add(new Setter(SeriesItemLabel.FontWeightProperty, FontWeights.Bold));
itemLabelStyle1.Setters.Add(new Setter { Property = SeriesItemLabel.FontWeightProperty, Value = FontWeights.Bold });
itemLabelStyle1.Setters.Add(new Setter { Property = SeriesItemLabel.FillProperty, Value = new SolidColorBrush(Colors.Transparent) });
BarSeriesDefinition definition1 = new BarSeriesDefinition();
definition1.ShowItemToolTips = true;
definition1.ShowItemLabels = true;
definition1.LabelSettings.LabelDisplayMode = LabelDisplayMode.Outside;
definition1.SeriesItemLabelStyle = itemLabelStyle1;
SeriesMapping mapping1 = new SeriesMapping();
mapping1.SeriesDefinition = definition1;
mapping1.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor("Type"));
mapping1.ItemMappings.Add(new ItemMapping("Count", DataPointMember.YValue));
mapping1.ItemMappings.Add(new ItemMapping("CreateDate", DataPointMember.XCategory));
SeriesMappingCollection mappings = new SeriesMappingCollection();
mappings.Add(mapping1);
this.DFSeriesMappings2 = mappings;
}
----------------------------------------------------------