Chart with currency formatted values

Hello all!
Before opening a new feature request, I ask to be sure if I don’t miss something.

Today I played with the new chart feature. I find it very useful!

I noticed that the values in the chart are formatted as “raw” double, but in 99% of my needs they will be “currency” values, something like 2.345,67 (“dot” for thousands and “comma” for decimals).

I played for 2 hours and I didn’t find nothing in the documentation… Do anyone have idea if I miss something? Or have I to open a new feature request?

Thanks a lot!

You should file a feature request. Changing to formatting is not what you need. You need it to take a chartdataset with a currency values. I think that’s a whole new variant.

1 Like

It may be just not knowing how to do? Didn’t the release come with examples? Datapoints could be doubles but have string labels to show instead?

Surely, you will run into all the issues with rounding that normally differ between Currency and Double.

For a chart with a datapoint as 1234,560000002527 with a companion representative label “US$ 1,234.56” it would be irrelevant. But I see his problem. I think there’s no such option.

Create a desktop app. Drag a chart component to a window and put this into the Opening() event:

// First dataset
Var data1() As Double
data1.Add 5
data1.Add 7
data1.Add 10
data1.Add 15
data1.Add 2
data1.Add 24

Var mySet1 As New ChartLinearDataset("Bar Data", Color.Red, True, data1)
mySet1.ChartType = ChartLinearDataset.ChartTypes.Bar

// Second dataset
Var data2() As Double

For i As Integer = 1 To 6
  data2.Add(System.Random.InRange(5, 40))

Var myset2 As New ChartLinearDataset("Line Data", Color.Blue, True, data2)
myset2.ChartType = ChartLinearDataset.ChartTypes.Line

Me.AddLabels("January", "February", "March", "April", "May", "June")

1 Like

Just FYI: It is worth setting the Mode to Bar if you are going to add bars to a chart. You get a far better first bar (you get a whole first bar):

I agree there is no formatting, however, I still worry that it won’t round items quite correctly if you are still using doubles in the chart.

As I said, it’s irrelevant as no one will see the real infinitesimal value, they should see the representative label you’ve set for such datapoint. But the y axis you wont have such control, for those we need a format mask.

Datapoints should not be array of Doubles, they need to carry more properties. Right now I think a Pair could be enough as (23.7201 : “R$23,72”) // value : substitute label , if label = Nil use value formatted using the format mask of the series (dataset). If label = “”, don’t print the value, if label > “” print the label.

We need the basic option to print the series values under request.


1 Like

Labeling the axis values will be available for r2. :wink: