Profile Picture

Format numbers

Posted By Luis Miguel Perez Lopez 11 Years Ago
Author
Message
Luis Miguel Perez Lopez
Posted 11 Years Ago
View Quick Profile
Forum Member

Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 29, Visits: 1
It works

Thanks

Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hi Luis,

You can solve this problem by creating a custom value formatter - for example:

      class CustomValueFormatter : NValueFormatter
      {
         public override string FormatValue(double value)
         {
            return value.ToString("#,###,##0.###########").Replace(",", " ");      
         }

         public override string FormatValue(object value)
         {
            return FormatValue((double)value);
         }
      }

      private void Form1_Load(object sender, EventArgs e)
      {
         NChart chart = nChartControl1.Charts[0];

         NLinearScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
         scale.LabelValueFormatter = new CustomValueFormatter();

         NBarSeries bar = new NBarSeries();
         bar.DataLabelStyle.Visible = false;

         DateTime now = DateTime.Now;

         for (int i = 0; i < 100; i++)
         {
            bar.Values.Add(i * i);
         }

         chart.Series.Add(bar);
      }


Let us know if you meet any problems.



Best Regards,
Nevron Support Team



Luis Miguel Perez Lopez
Posted 11 Years Ago
View Quick Profile
Forum Member

Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 29, Visits: 1
I have the following code:

Dim axisY As NAxis = Chart.Axis(StandardAxis.PrimaryY)
Dim lsc As NLinearScaleConfigurator = CType(axisY.ScaleConfigurator, NLinearScaleConfigurator)

lsc.LabelValueFormatter = New NNumericValueFormatter("#,###,##0.###########")

Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = lsc

What I want is put the numbers with blanc spaces instead of "comas". I tried this but it doesn't work:

lsc.LabelValueFormatter = New NNumericValueFormatter("# ### ##0.###########")

Is there any solution for that issue ????



Similar Topics


Reading This Topic