Adding Dynamic Tokens with Google Charts

I have a chart that I created using google charts. I would like to add a dynamic marker to mark a specific point in this diagram (and later I want to add a horizontal line). It looks like it should be possible using the chm parameter, but I can't get it to work - the chart draws, but not a marker.

I tried various permutations with the chm parameter to no avail. It looks like this should be a valid parameter for a line chart. What am I missing?

Here is my code:

function drawIterationHistory() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Iteration'); data.addColumn('number', 'Other'); data.addColumn('number', 'Fail'); data.addColumn('number', 'Not Run'); data.addColumn('number', 'Pass'); data.addRows([ ['1', 0, 5, 90, 5], ['2', 1, 8, 82, 10], ['3', 2, 12, 60, 40], ['4', 2, 30, 20, 60], ['5', null, null, null, null], ['6', null, null, null, null] ]); var options = { width: 450, height: 240, title: 'Test Plan Iteration History', isStacked: 'true', hAxis: {title: 'Iteration'}, vAxis: {title: 'Test Cases'}, chm: '@a,FF0000,1,2:20,1' // This line does not seem to have an effect }; var chart = new google.visualization.LineChart(document.getElementById('iterationHistory')); chart.draw(data, options); } 
+4
source share

Source: https://habr.com/ru/post/1397535/


All Articles