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

Free Support Forum - aspose.com

Gradient Markers

Hi,

How can i set the gradient style for markers. I am trying below section of code. But when i am applying below code my output is getting corrupted and file is not opening.

series.MarkerFill.Fill.FillType = FillTypeEx.Gradient;
series.MarkerFill.Fill.SolidFillColor.Color = Blue;
series.MarkerFill.Line.FillFormat.GradientFormat.GradientShape = GradientShapeEx.Linear;
series.MarkerFill.Line.FillFormat.GradientFormat.GradientDirection = GradientDirectionEx.FromCorner1;
series.MarkerFill.Line.FillFormat.GradientFormat.GradientDirection = GradientDirectionEx.FromCorner1;
series.MarkerFill.Line.FillFormat.GradientFormat.GradientStops.Add(float.Parse(1), Blue);
series.MarkerFill.Line.FillFormat.GradientFormat.GradientStops.Add(100, Red);
series.MarkerFill.Effect3D.Camera.CameraType = CameraPresetTypeEx.OrthographicFront;
series.MarkerFill.Effect3D.BevelBottom.BevelType = BevelPresetTypeEx.SoftRound;
series.MarkerFill.Effect3D.BevelBottom.Height = 10;
series.MarkerFill.Effect3D.BevelTop.BevelType = BevelPresetTypeEx.SoftRound;
series.MarkerFill.Effect3D.BevelTop.Height = 5;

Can you please tell me how can i do so?

Thanks,

Amit

Hi Amit,


I have observed the sample code shared and observed the inconsistency in that. Please try using the following sample on your end to serve the purpose. Please share, if I may help you further int this regard.

series.MarkerSymbol = MarkerStyleTypeEx.Square;
series.MarkerFill.Fill.FillType = FillTypeEx.Gradient;
series.MarkerSize = 4;
series.MarkerFill.Fill.GradientFormat.GradientShape = GradientShapeEx.Linear;

//Set the Gradient Direction
series.MarkerFill.Fill.GradientFormat.GradientDirection = GradientDirectionEx.FromCorner2;
//Add two Gradiant Stops
series.MarkerFill.Fill.GradientFormat.GradientStops.Add((float)1.0, PresetColorEx.Purple);
series.MarkerFill.Fill.GradientFormat.GradientStops.Add((float)0, PresetColorEx.Red);

//Adding Gradient for marker line
series.MarkerFill.Line.Width = 3;
series.MarkerFill.Line.FillFormat.FillType = FillTypeEx.Gradient;
series.MarkerFill.Line.FillFormat.GradientFormat.GradientShape = GradientShapeEx.Linear;
series.MarkerFill.Line.FillFormat.GradientFormat.GradientDirection = GradientDirectionEx.FromCorner1;
series.MarkerFill.Line.FillFormat.GradientFormat.GradientStops.Add(float.Parse(“1”), Color.Blue);
series.MarkerFill.Fill.GradientFormat.GradientStops.Add((float)0, PresetColorEx.Red);

//Adding 3D effects
series.MarkerFill.Effect3D.Camera.CameraType = CameraPresetTypeEx.OrthographicFront;
series.MarkerFill.Effect3D.BevelBottom.BevelType = BevelPresetTypeEx.SoftRound;
series.MarkerFill.Effect3D.BevelBottom.Height = 10;
series.MarkerFill.Effect3D.BevelTop.BevelType = BevelPresetTypeEx.SoftRound;
series.MarkerFill.Effect3D.BevelTop.Height = 5;


Many Thanks,