Hi,
if (rcPieBudgetItems.Series[0].Type == ChartSeriesType.Bar)
{
isPieChart = false;
for (int i = 0; i < rcPieBudgetItems.Series[0].Items.Count; i++)
{
rcPieBudgetItems.Series[0].Items[i].Appearance.FillStyle.MainColor = rcPieBudgetItems.CustomPalettes[0].Items[i].MainColor;
rcPieBudgetItems.Series[0].Items[i].Appearance.FillStyle.SecondColor = rcPieBudgetItems.CustomPalettes[0].Items[i].SecondColor;
}
(rgLegend.MasterTableView.GetColumn("gncValueColumn") as GridNumericColumn).DataFormatString = "{0:C}";
}
else
{
isPieChart = true;
if (rcPieBudgetItems.CustomPalettes.Count == 0 && rcPieBudgetItems.Series[0].Items.Count > 0)
{
rcPieBudgetItems.CustomPalettes.Add(MyColorPalette.CustomPalettesHelper(rcPieBudgetItems.Series[0].Items.Count));
rcPieBudgetItems.SeriesPalette = rcPieBudgetItems.CustomPalettes[0].Name;
}
(rgLegend.MasterTableView.GetColumn("gncValueColumn") as GridNumericColumn).DataFormatString = "{0:0.00}%";
}
MyColorPalette.CustomPalettesHelper will return a Palette based on a number. When I click on the image it will change the chart type from pie to chart or chart to pie and call the code above. The problem is the colors in pie chart is fine, but in bar chart they always have the same color as the first color in the CustomPalette even though I set the color values manually. By the way, if I set filltype in the code above then it will pick up the new fill type but not the color.
Will really appreciate if anyone can give me some suggestions based on that. I'll wait online.
Thanks a mill.
if (rcPieBudgetItems.Series[0].Type == ChartSeriesType.Bar)
{
isPieChart = false;
for (int i = 0; i < rcPieBudgetItems.Series[0].Items.Count; i++)
{
rcPieBudgetItems.Series[0].Items[i].Appearance.FillStyle.MainColor = rcPieBudgetItems.CustomPalettes[0].Items[i].MainColor;
rcPieBudgetItems.Series[0].Items[i].Appearance.FillStyle.SecondColor = rcPieBudgetItems.CustomPalettes[0].Items[i].SecondColor;
}
(rgLegend.MasterTableView.GetColumn("gncValueColumn") as GridNumericColumn).DataFormatString = "{0:C}";
}
else
{
isPieChart = true;
if (rcPieBudgetItems.CustomPalettes.Count == 0 && rcPieBudgetItems.Series[0].Items.Count > 0)
{
rcPieBudgetItems.CustomPalettes.Add(MyColorPalette.CustomPalettesHelper(rcPieBudgetItems.Series[0].Items.Count));
rcPieBudgetItems.SeriesPalette = rcPieBudgetItems.CustomPalettes[0].Name;
}
(rgLegend.MasterTableView.GetColumn("gncValueColumn") as GridNumericColumn).DataFormatString = "{0:0.00}%";
}
MyColorPalette.CustomPalettesHelper will return a Palette based on a number. When I click on the image it will change the chart type from pie to chart or chart to pie and call the code above. The problem is the colors in pie chart is fine, but in bar chart they always have the same color as the first color in the CustomPalette even though I set the color values manually. By the way, if I set filltype in the code above then it will pick up the new fill type but not the color.
Will really appreciate if anyone can give me some suggestions based on that. I'll wait online.
Thanks a mill.