I do an export in Excel and draw charts using Epplus:
var chart = (ExcelChart)wksh.Drawings.AddChart("Chart", eChartType.Line);
chart.SetSize(500, 300);
chart.SetPosition(5, 800);
chart.Title.Text = "myChart";
chart.Series.Add(ExcelRange.GetAddress(2, 26, rowIndex, 26), ExcelRange.GetAddress(2, 25, rowIndex, 25));
And get the chart from left to right by default:

How do I get the chart from right to left??

For example, in excel in properties there is a parameter "categories in reverse order":
how it is done in the Epplus?.
I had a similar problem in which I wanted to flip my y axis, which I fixed with
chart.YAxis.Orientation = eAxisOrientation.MaxMin;
If you wanted to do x then the same thing (but with x) should work
chart.XAxis.Orientation = eAxisOrientation.MaxMin;
You may also want to set
chart.XAxis.MinValue
chart.XAxis.MaxValue
chart.XAxis.Crosses
If your formatting looks wonky
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With