Change SetData delimiter

P

Preben Zacho

Is it possible to change the separator sign of the SetData method? I want to
do this because it conflicts with the decimal separator sign in my global
settings.

Example in C#:

XValues = "123,00,124,00,125,00"; // The 3 values should be
123,00 and 124,00 and 125,00
chart.SeriesCollection[1].SetData (ChartDimensionsEnum.chDimValues,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, XValues);

As you can see, the decimal separator is a comma sign, but the same sign is
used as separator in the SetData method (son SetData in this case thinks
there are 6 values instead of 3). I want to change the SetData separator
sign to fx. # or similar. Possible?

It's not an option to load it to a spreadsheet first. Nor can I change the
decimal separator in the global settings at run-time, since other programs
depend on this value. I have also tried to change the XValues to an array,
but the the chart becomes empty (no series added and no errors produced)

Regards,

PZ
 
P

Preben Zacho

Thx for the answer. However the result is the same. I did it like this:

XValues = "123,00\t124,00\t125,00";

Still it produces twice the values at it should, half of them are 0.

Regards,

PZ

Alvin Bruney said:
\t will work instead of a comma

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Preben Zacho said:
Is it possible to change the separator sign of the SetData method? I want
to do this because it conflicts with the decimal separator sign in my
global settings.

Example in C#:

XValues = "123,00,124,00,125,00"; // The 3 values should be
123,00 and 124,00 and 125,00
chart.SeriesCollection[1].SetData (ChartDimensionsEnum.chDimValues,
(int)ChartSpecialDataSourcesEnum.chDataLiteral, XValues);

As you can see, the decimal separator is a comma sign, but the same sign
is used as separator in the SetData method (son SetData in this case
thinks there are 6 values instead of 3). I want to change the SetData
separator sign to fx. # or similar. Possible?

It's not an option to load it to a spreadsheet first. Nor can I change
the decimal separator in the global settings at run-time, since other
programs depend on this value. I have also tried to change the XValues to
an array, but the the chart becomes empty (no series added and no errors
produced)

Regards,

PZ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top