我正在使用google chart的组合堆叠栏。我想显示h轴的显式值,所以我使用ticks选项。但是,在使用此选项后,我的图形一次显示沿h轴的所有条形值。但是,我希望将条限制为一次5条,并通过滑动charRangeFilter来动态显示其余的条。当我使用ticks选项时,这些条几乎显示为直线,如图所示。可以帮我解决这个问题吗?任何帮助都是非常感谢的
以下是图表选项的代码
let hTicks = new Array<Date>(); // I already populated this array with Dates
let chart = new google.visualization.ChartWrapper({
'chartType': 'ComboChart',
'containerId': 'chartRangeFilter_chart_div',
'options': { .
// Use the same chart area width as the control for . axis alignment.
'width': '100%',
'height': '100%',
'hAxis': { 'title': 'DATES', 'gridlines': { 'color': 'transparent' }, 'ticks': hTicks, 'slantedText': true, 'slantedTextAngle': hTicks.length <= 10 ? 45 : 90 },
'legend': 'none',
'vAxis': { 'title': 'CABINS', 'viewWindow': { 'min': 0, 'max': (Number(cabinTotal) * 1.5) } },
'seriesType': 'bars',
'chartArea': { 'height': '50%', 'width': '85%' },
'bar': { 'groupWidth': '15%' },
'series': { 4: { 'type': 'line' } },
'isStacked': true,
'colors': ['#95d631', '#d7d7d7', '#f44336', '#00bcd4', '#ffc107']
} 以下是图表
发布于 2020-05-02 05:31:45
通过在用户滑动chartFilter时动态更新刻度来解决
https://stackoverflow.com/questions/51733958
复制相似问题