How can I change the currency format in chartjs bar chart?

0
0

List<string> formattedData = rawData.Select(d => d.ToString(“C2”, CultureInfo.GetCultureInfo(“es-MX”))).ToList();
var barDataSet1 = new BarDataSet
{
Data = rawData.Cast<object>().ToArray(), // ChartJS still uses the raw data internally
Formatted = formattedData.ToArray() // This array is used for display (tooltips, datalabels)
};
barDataSet1.BackgroundColor = new[] { Color.LightSeaGreen, Color.ForestGreen, Color.LightYellow, Color.Orange, Color.IndianRed, Color.Red }; //randomColors1.ToArray();
barDataSet1.BorderColor = null;
barDataSet1.Data = ConvertirCadenaADouble(Cadena_Cant_Cartera_Barras.ToString());
barDataSet1.HoverBackgroundColor = null; // null;
barDataSet1.Label = null;
string[] vs1 = Cadena_Cartera_Vencimiento_Barras.Split(‘,’).ToArray();
barDataSet1.Formatted = formattedData.ToArray();
chartJS2.Labels = vs1;
chartJS2.DataSets.Add(barDataSet1);

I do the formatting and still the currency format does not change. What do I need to do? My version is Wisej 2.54

 

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.