google charts: timeline Scale

google charts: timeline Scale



I use angular 6. In google chart timeline, how i can set the scale of the timeline to show just weeks or month, not show the day.



I set my graph like that :



Basegraph service


declare var google: any;

export class GoogleChartsBaseService
constructor()
google.charts.load('current', 'packages':["timeline"], 'language': 'fr');


protected buildChart(data: any, chartFunc: any, options: any) : void
var func = (chartFunc, options) =>
var datatable = google.visualization.arrayToDataTable(data);
chartFunc().draw(datatable, options);
;
var callback = () => func(chartFunc, options);
google.charts.setOnLoadCallback(callback);





Timeline service


import GoogleChartsBaseService from './google-charts-base.service';
import Injectable from '@angular/core';
import GanttChartConfig from './../models/GanttChartConfig.model';

declare var google: any;

@Injectable()
export class GoogleGanttChartService extends GoogleChartsBaseService

constructor() super();

public BuildPieChart(elementId: string, data: any, config: GanttChartConfig) : void
var chartFunc = () => return new google.visualization.Timeline(document.getElementById(elementId)); ;

var rowHeight = 41;
var chartHeight = data.length * rowHeight + 50;

var options =
traitement: config.traitement,
datedebut: config.datedebut,
datefin: config.datefin,
chartArea:,
height: chartHeight
;
this.buildChart(data, chartFunc, options);





1 Answer
1



Simply set hAxis.


var options = {
traitement: config.traitement,
datedebut: config.datedebut,
datefin: config.datefin,
chartArea:,
height: chartHeight,


hAxis:
format: 'dd MMMM yyyy',






While this code snippet may be the solution, including an explanation really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion.
– Narendra Jadhav
Aug 27 at 13:39






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)