Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 我想画一条水平线_Angular_Chart.js_Bar Chart - Fatal编程技术网

Angular 我想画一条水平线

Angular 我想画一条水平线,angular,chart.js,bar-chart,Angular,Chart.js,Bar Chart,我想用chart js在我的图表栏上画一条水平线,我在图表选项中添加了注释元素,但它不起作用 annotation: { annotations: [{ type: 'line', mode: 'horizontal', scaleID: 'y-axis-0', value: 5, borderColor: 'rgb(75, 192, 192)', borderWidth: 4,

我想用chart js在我的图表栏上画一条水平线,我在图表选项中添加了注释元素,但它不起作用

annotation: {
      annotations: [{
        type: 'line',
        mode: 'horizontal',
        scaleID: 'y-axis-0',
        value: 5,
        borderColor: 'rgb(75, 192, 192)',
        borderWidth: 4,
        label: {
          enabled: false,
          content: 'Test label'
        }
      }]
    }

annotation: {
      annotations: [{
        type: 'line',
        mode: 'horizontal',
        scaleID: 'y-axis-0',
        value: 5,
        borderColor: 'rgb(75, 192, 192)',
        borderWidth: 4,
        label: {
          enabled: false,
          content: 'Test label'
        }
      }]
    }

我想在我的条形图js上画一条水平线。

在测试时效果很好。你是否正确导入了插件,比如


它的工作原理与您的代码完全相同(我只更改了值)。

在我测试它时工作正常。你是否正确导入了插件,比如

它的工作原理与您的代码完全相同(我只更改了值)