We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Charts.Series.MarkerForegroundColorSetType is now obsolete - whats the alternative?

Hi there,


We used to use Aspose.Charts.Series.MarkerForegroundColorSetType and set it to FormattingType.Custom. However, this is now obsolete in version 8.0.1 of Aspose Cells. Upon hovering you recommend that

’Use Marker.Border.Formatting property instead’

Example code FYI:

Series series = mainChart.NSeries[mainChart.NSeries.Count - 1];
series.MarkerForegroundColorSetType = FormattingType.Custom;
series.Marker.MarkerStyle = ChartMarkerType.Diamond;
series.Marker.MarkerSize = 4;


The issue is I tried series.Marker.Border.Formatting - but that property doesn’t exist! (So there’s possibly a bug/error on the text you are using in the warning recommendation) The nearest thing I could see was series.Marker.Border.FormattingType but that doesn’t have ‘custom’ like before. What should I be using to replicate series.MarkerForegroundColorSetType = FormattingType.Custom?

Hi Adam,

Thanks for your posting and using Aspose.Cells.

You are right. The alternative property Marker.Border.Formatting does not exist and Marker.Border.FormattingType does not have “FormattingType.Custom”.

We have logged this issue in our database for investigation. We will look into it and provide you an alternative. Once, there is some update for you, we will let you know asap.

This issue has been logged as CELLSNET-42626.

Hi,


I think you may try the following line of code with the new version:
e.g
Sample code:

series.Marker.Area.Formatting = FormattingType.Custom;

Let us know if you still have any problem.

Thank you.

Hi,

I actually had this originally:

series.MarkerBackgroundColorSetType = FormattingType.Custom;
series.MarkerForegroundColorSetType = FormattingType.Custom;

I replaced the top one with what you suggest already (as that’s what the warning message said to do), but you are suggesting that .MarkerForegroundColorSetType can also be replaced by the same thing…

so is it the case that BOTH of the above can now be replaced by your suggestion?

Hi,


Please try as per my suggested line of code, it should work fine accordingly. If you still find the issue, kindly provide your sample code (runnable) with latest version v8.0.1.x with template files, we will check it soon.

Thank you.

Hi,

Thanks for using Aspose.Cells.

Aspose.Charts.Series.MarkerForegroundColorSetType is designed for Excel 2003. In Excel 2007 or later, Marker is an object of series and replace Custom type with Solid type.

We think Excel 2003 will be not supported in the distant future. So we suggest it is best to use Marker.Border.Formatting property instead.

The relation is:

  • FormattingType.Automatic is same as ChartLineFormattingType.Automatic.
  • FormattingType.None is same as ChartLineFormattingType.None.
  • FormattingType.Custom is same as ChartLineFormattingType.Solid.


Please check the attachment, it contains a simple test that illustrates how to set the border’s color of marker and fill color of marker.