If you want only the Mondays to show up, you'll need to set the type of the first column to 'string' not 'date'. Type 'date' produces a continuous axis (a timeline, in this case), so the displayed axis values need not line up with specific data points; type 'string' produces a discrete axis where every point has it's own axis label. You could, using a string type, simply set each value to the month instead of a date (ie, 'January', 'February', 'March', etc).
I should also point out that you don't have any valid options in your options array; see the list of available options here: http://code.google.com/apis/chart/interactive/docs/gallery/linechart.html#Configuration_Options On Tuesday, February 28, 2012 12:52:27 PM UTC-5, gaëlle fernandez wrote: > > Hi everybody! > (first of all, excuse my bad english, i'm a beginner) > > i want to draw a linechart of percent by dates (percent in y and dates > in x axis) > i want to symbolize each week of a current month by just display each > monday of each week. > (all of these mondays are stocked into a array called mondays[].) > > so, my chart will have just 4 or 5 visible dates on the x-axis. > > i tried to work with the chxr parameter by changing it in the options > here is how i set my columns : > > var chartTimeLine = new google.visualization.DataTable(); > chartTimeLine.addColumn('date', 'Temps'); > chartTimeLine.addColumn('number','Fréquence'); > for (var j=0;j<mesFreq.length;j++){ > chartTimeLine.addRows([ > [mondays[j],mesFreq[j]] > ]) > } > > var myOptions = { > axis_index:0, > start_val:mondays[0], > end_val:mondays[mondays.length-1], > opt_step:mondays.length/2 > } > > var chartLine = new google.visualization.LineChart(myDiv); > chartLine.draw(chartTimeLine, myOptions); > > so, my result shows me a chart with several dates of my current month > and not just the four mondays i would like to display. > > Do you have any idea on what is the problem and how i can fix it, > please? > > (and i don't want to use an annotated time line) > > Thanks! > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/haAplDneppoJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
