Logarithmic Scale in Charts

Hi,

I want dynamic values at origin of chart, so i added below code:

chart.Axes.VerticalAxis.IsAutomaticMinValue = false;
chart.Axes.VerticalAxis.IsLogarithmic = true;
chart.Axes.VerticalAxis.MinValue = 1000;

I have attached PPT generated using above code.

As min values cannot be fixed by removing it from code, PPT is generated with errors.

So, I tried keeping IsAutomaticMinValue as true, then by default MinValue is considered as 1 and then I can't assign it from code side. I don't want 1 as min value. It can be 100,1000,10000.... based on data.

Please provide a solution for dynamic generation of axis values based on how large are the ranges of data.

Hi Jonathan,

Thanks for inquiring Aspose.Slides.

I have observed the sample code as well as generated presentation file and unfortunately have not been able to completely understand the requirement. Can you please share the working sample project along with source presentation, generated presentation with issues and also the desired output presentation that you want to generate. I will be able to investigate the issue further on provision of requested information.

Many Thanks,

Hi Mudassir,


Thanks for the reply.

I am sorry I can’t attach sample project but I am sharing with you a video which shows how the range is changed in chart in our UI which is our desired output in presentation.

I have attched our
  • Source presentation
  • Generated presentation(WhenAutomaticIsFalse.pptx) for which I have applied following coding
chart.Axes.VerticalAxis.IsAutomaticMinValue = false; chart.Axes.VerticalAxis.IsLogarithmic = true;
// chart.Axes.VerticalAxis.MinValue = 1000;

I want Min Value to adjust like in our UI chart without providing it from code side. So I commented the last line in above code which produced a presentation with error and not showing its slide.
  • Generated presentation(WhenAutomaticIsTrue.pptx) for which I have applied following coding
chart.Axes.VerticalAxis.IsAutomaticMinValue = true;
chart.Axes.VerticalAxis.IsLogarithmic = true;
chart.Axes.VerticalAxis.MinValue = 1000;

When IsAutomaticMinValue and IsLogarithmic both are true, the min value is considered as 1 and not the one I provided.

My requirement is to get dynamic values for min value as per the UI that I shared with you.

Thanks.

Hi Jonathan,

I have tried to understand the requirements shared by you and still things are not getting clear. Do you want to dynamically set the chart series data point values?

As far as your following question related to code sample is concerned.

sdtechsupport@siriusdecisions.com:

  • Generated presentation(WhenAutomaticIsFalse.pptx) for which I have applied following coding
chart.Axes.VerticalAxis.IsAutomaticMinValue = false; chart.Axes.VerticalAxis.IsLogarithmic = true;
// chart.Axes.VerticalAxis.MinValue = 1000;


This is issue in your code. At one end you are setting IsAutomaticMinValue to false and on other end you have commented the line whereby you need to set the MinValue yourself. Actually, IsAutomaticMinValue=false means that you will set the MinValue yourself. So when you comment the MinValue line, the charts get corrupted and you get false presentation. This is not an issue but wrong implementation.
sdtechsupport@siriusdecisions.com:

I
want Min Value to adjust like in our UI chart without providing it from
code side. So I commented the last line in above code which produced a
presentation with error and not showing its slide.


If you set the IsAutomaticMinValue to true, Aspose.Slides charting engine will automatically choose the value for you based on chart series data.

I hope the shared information will be helpful.

Many Thanks,
chart.Axes.VerticalAxis.IsAutomaticMinValue = true;