Hello.
Am I missing sth?
Hello.
Hi Kostas,
I have worked over the scenario shared by you in detail and have also observed the other thread mentioned by you. Actually, what you are looking for is setting the date axis for category axis. Unfortunately, the desired support is presently not available in Aspose.Slides. Since there is no support for Date Axis so even if you add the date type by following custom data format in respective excel sheet, it will not work. I have created an issue with ID SLIDESNET-34668 in our issue tracking system as new feature support to provide support for Date axis as attached in the image shared. This will serve the purpose for you. For your kind reference, I have also devised some workaround approach for setting the date format for value axis of chart. This may help you as well in some other scenario as work around.
public static void testChart()
{
PresentationEx pres = new PresentationEx();
SlideEx sld = pres.Slides[0];
ChartEx chart = sld.Shapes.AddChart(ChartTypeEx.ClusteredColumn, 10, 60, 700, 300);
ChartSeriesEx series = chart.ChartData.Series[0];
String Sername = series.NameCells.GetConcateNameFromCells;
ChartDataCell cell = series.NameCells[0];//0 is series index
chart.ValueAxis.SourceLinked=false;
chart.ValueAxis.BaseUnitScale=TimeUnitType.Months;
//
//[$-409]mmm-yy;@
// chart.getValueAxis().setNumberFormat("[$-409]mmm-dd;@");
chart.ValueAxis.NumberFormat=“mmm-yyyy”;
chart.ValueAxis.IsAutomaticMajorUnit=false;
chart.ValueAxis.IsAutomaticMinorUnit=false;
chart.ValueAxis.IsAutomaticMaxValue=false;
chart.ValueAxis.IsAutomaticMinValue=false;
//Starting day number
// chart.getValueAxis().setMinValue(13);
chart.ValueAxis.MinValue=(365.25f * 109) + 163;
//Ending day number
// chart.getValueAxis().setMaxValue(365);
chart.ValueAxis.MaxValue=(365.25f * 110) + 15;
//Setting month wise interval
chart.ValueAxis.MajorUnit=30.5f;
//setting minor unit to 10 days
chart.ValueAxis.MinorUnit=10;
chart.ValueAxis.MinorUnitScale=TimeUnitType.Days;
chart.ValueAxis.MajorUnitScale=TimeUnitType.Months;
chart.HasLegend=false;
pres.Write(path+“Bar2.pptx”);
}
The issues you have found earlier (filed as SLIDESNET-34668) have been fixed in this update.