Hi,
I'm developing a Xamarin application targeting Android and iOS and I'm having some issues when trying to change chart's legend text color.
My hunch is that is something related to the palette, but I couldn't figure out where the problem might be.
Here is part of my code:
//Create the Chart View
RadCartesianChartView chart =
new
RadCartesianChartView(
this
.Activity);
chart.Background =
new
global::Android.Graphics.Drawables.ColorDrawable(Color.White);
/* Add some behavior here */
/* Axes and so on */
var customPalette =
new
ChartPalette(chart.Palette);
PaletteEntry linesPalette = customPalette.GetEntry(ChartPalette.LineFamily, 0);
/* Apply my colors here */
chart.Palette = customPalette;
// As there are many series, I iterate through them in order to show them together
foreach
(ScatterPointSeries chartSeries
in
series)
{
chartSeries.XValueBinding = hvb;
chartSeries.YValueBinding = vvb;
chartSeries.CanApplyPalette =
false
;
chartSeries.StrokeThickness = 5.0f;
chartSeries.VerticalAxis = verticalAxis;
chartSeries.HorizontalAxis = horizontalAxis;
chart.Series.Add(chartSeries);
}
// Legengs
var legendView =
new
RadLegendView(
this
.Activity);
legendView.LegendProvider = chart;
var layoutParams =
new
LinearLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent, GetLegendsHeight(series.Length));
layoutParams.SetMargins(5, 5, 5, 5);
legendView.LayoutParameters = layoutParams;
// And finally I add both views to the layout
linearLayout.AddView(legendView);
linearLayout.AddView(chart);
As you can see in the attached screenshot, legend text is grayed out. I'm expecting to see the text color black.
Am I missing something?
Many thanks in advance!