Line Chart X-Axis Data Points

36 views
Skip to first unread message

Jonathan Katon

unread,
Oct 4, 2013, 5:43:19 PM10/4/13
to ax...@googlegroups.com
I am creating a line chart with axlsx and I am unable to figure out how you can specify the data points to use from your sheet for the x axis. The chart defaults to starting the x axis to 0 and each data point increments that count by 1. I have included screen shots below of the output that I get vs the output that I would like to have. 

Let me explain the scenario. I have a sheet which has week numbers listed. Each week there is a corresponding demand and capacity. With this we we can compare the capacity to demand on a week to week basis. If the chart were to be created today looking forward over the next year the left most x value would be week 40. It would continue incrementing to week 52 and then it would start over at 1 instead of incrementing anymore.


An example data set would be



This is what I get when I create the line chart with axlsx:


This is what I want to get when I create the line chart with axlsx. This chart is exactly the same except once I open axlsx's output in excel I update the data source for the chart so that the cells are defined where it should get the data for the x axis.

An alternative way I can obtain the results I want is to create a scatter chart with axlsx and then when I open it in excel I change the chart type to a line chart. I dont have to update the data source for the chart in this case because in axlsx code the scatter chart allows you to specify the "xData" and "yData" whereas line chart only lets you specify the "data"


Thank You very much for any help!!!
Reply all
Reply to author
Forward
0 new messages