Current filter:
                                You should refresh the page.
                                  • Description:
                                    I am getting the following warning messages:

                                    DevExpress.XtraCharts.SeriesLabelBase.PointOptions' is obsolete: '"This property is obsolete now. Use the TextPattern property instead.
                                    DevExpress.XtraCharts.SeriesBase.LegendPointOptions' is obsolete: 'This property is obsolete now. Use the LegendTextPattern property instead.

                                    How should I change my code according these new properties?

                                    Answer:
                                    We have implemented the Support advanced pattern syntax for Label and Legend point options functionality in version 14.1 and introduced TextPattern properties (SeriesLabelBase.TextPattern, AxisLabel.TextPatternSeriesBase.LegendTextPattern), which simplify text customization of series labels, axis labels and legend items (when the ColorEach mode is enabled). They use format strings that are described in Standard Numeric Format StringsCustom Numeric Format StringsStandard Date and Time Format Strings  and Custom Date and Time Format Strings  topics in MSDN.
                                    These new properties replace old ones (SeriesLabelBase.PointOptions, AxisLabel.NumericOptions, AxisLabel.DateTimeOptions, SeriesBase.LegendPointOptions), which are marked as obsolete.

                                    IMPORTANT If obsolete properties are placed in the form designer code, you can simply change any property in the chart at design time via the chart wizard or Properties window. In this case, the designer code will be updated with new properties automatically.

                                    There is a code snippet that illustrates how to replace old properties with new ones:

                                    SeriesLabelBase.TextPattern:

                                    [C#]
                                    //Case 1 PiePointOptions piePointOptions = series.Label.PointOptions as PiePointOptions; piePointOptions.PercentOptions.ValueAsPercent = true; piePointOptions.ValueNumericOptions.Precision = 0; piePointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.Percent; series.Label.TextPattern = "{VP:p0}"; //Case 2 PiePointOptions piePointOptions = series.Label.PointOptions as PiePointOptions; piePointOptions.PercentOptions.ValueAsPercent = false; piePointOptions.ValueNumericOptions.Precision = 2; piePointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.Currency; series.Label.TextPattern = "{V:c2}";
                                    [VB.NET]
                                    'Case 1 Dim piePointOptions As PiePointOptions = TryCast(series.Label.PointOptions, PiePointOptions) piePointOptions.PercentOptions.ValueAsPercent = True piePointOptions.ValueNumericOptions.Precision = 0 piePointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.Percent series.Label.TextPattern = "{VP:p0}" 'Case 2 Dim piePointOptions As PiePointOptions = TryCast(series.Label.PointOptions, PiePointOptions) piePointOptions.PercentOptions.ValueAsPercent = False piePointOptions.ValueNumericOptions.Precision = 2 piePointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.Currency series.Label.TextPattern = "{V:c2}"

                                    SeriesBase.LegendTextPattern

                                    [C#]
                                    //Case 1 series.LegendPointOptions.PointView = DevExpress.XtraCharts.PointView.Argument; series.LegendTextPattern = "{A}"; //Case 2 series.LegendPointOptions.PointView = PointView.ArgumentAndValues; series.LegendPointOptions.ValueNumericOptions.Precision = 2; series.LegendTextPattern = "{A} - {V:n2}";
                                    [VB.NET]
                                    'Case 1 series.LegendPointOptions.PointView = DevExpress.XtraCharts.PointView.Argument series.LegendTextPattern = "{A}" 'Case 2 series.LegendPointOptions.PointView = PointView.ArgumentAndValues series.LegendPointOptions.ValueNumericOptions.Precision = 2 series.LegendTextPattern = "{A} - {V:n2}"

                                    AxisLabel.TextPattern

                                    [C#]
                                    //Case 1 axis.Label.NumericOptions.Format = NumericFormat.Number; axis.Label.NumericOptions.Precision = 3; axis.Label.TextPattern = "{A:n3}"; //Case 2 axis.Label.DateTimeOptions.Format = DateTimeFormat.ShortTime; axis.Label.TextPattern = "{A:t}";
                                    [VB.NET]
                                    'Case 1 axis.Label.NumericOptions.Format = NumericFormat.Number axis.Label.NumericOptions.Precision = 3 axis.Label.TextPattern = "{A:n3}" 'Case 2 axis.Label.DateTimeOptions.Format = DateTimeFormat.ShortTime axis.Label.TextPattern = "{A:t}"
                                Show all comments
                                • Chris Seickel 06.10.2014

                                  The only problem with the standard .Net string formatting is that I don't think there is any way to format a date into a quarter.  Can you tell me how I would recreate the DateTimeFormat.QuarterAndYear with a TextPattern?

                                • John (DevExpress Support) 06.11.2014

                                  To achieve this format use the "{A:q}" TextPattern.
                                  We will add this information into our documentation.

                                • Chris Seickel 06.11.2014

                                  That's certainly intuitive enough now that I see it....  Thank you.

                                • Daniel Kaminski 08.25.2014

                                  Hi,
                                  How could I convert this
                                  diagram.AxisY.Label.NumericOptions.Format =  NumericFormat.Scientific;
                                  to the new Pattern format?

                                • Daniel Kaminski 08.25.2014

                                  Answered my own question...
                                  diagram.AxisY.Label.TextPattern = "{V:E1}";

                                • Divya Sivaraman 09.15.2014

                                  how do i convert the below
                                  Dim PiePointOptions3 As DevExpress.XtraCharts.PiePointOptions = New DevExpress.XtraCharts.PiePointOptions()
                                  PiePointOptions3.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.General
                                  Doughnut3DSeriesLabel2.PointOptions = PiePointOptions3

                                • John (DevExpress Support) 09.15.2014

                                  Hi Divya,
                                  Try the following code:

                                  [C#]
                                  Dim PiePointOptions3 As New DevExpress.XtraCharts.DoughnutSeriesLabel() doughnutSeriesLabel1.TextPattern = "{V}" 'or {V:n} series1.Label = doughnutSeriesLabel1

                                  If obsolete properties are placed in the form designer code, you can simply change the Series.Label.TextPattern property at design time via the chart wizard or Properties window. In this case, the designer code will be updated with new properties automatically.

                                • Teddy 09.18.2014

                                  Hi,
                                  What about if I want to get Series(0).Label.PointOptions.ValueNumericOptions.Precision only or to set Series(0).Label.PointOptions.ValueNumericOptions.Precision only?
                                  Which it has integer value?

                                • John (DevExpress Support) 09.18.2014

                                  We use Standard Numeric Format Strings to format values. These formats do not allow to obtain or specifying only precision. It is necessary to assign TextPattern both with a format specifier and precision.
                                  To get the precision, it is necessary to parse TextPattern manually.

                                • Mike Murdock 10.26.2017

                                  I just love when you copy and paste C# code to vb.net code and don't change the code to vb.net? with above example can you do so.

                                  Thank You

                                • Alex (DevExpress Support) 10.27.2017

                                  Hi Mike,

                                  Could you please clarify which code snippet should be converted to VB.NET? We will be happy to help you.

                                0 Solutions

                                Creation Date Importance Sort by