question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not show vertical line

See original GitHub issue

Hi,

I’m using plugin annotation in vue-chart-js, but not show.

What’s wrong?

<graph
            ref="chartLiquid"
            v-show="!isShowing"
            v-if="oilshow == false"
            :height="180"
            :chart-data="liquid"
            :options="chartOptions"
          />
<script>
import ChartAnnotationsPlugin from "chartjs-plugin-annotation";
Chart.plugins.register(ChartAnnotationsPlugin);
</script>
this.chartOptions = {
            title: {
              display: true,
              text: responseData.map(item => item.name)
            },
            pan: {
              enabled: true,
              mode: "x"
            },
            zoom: {
              enabled: true,
              mode: "x",
              speed: 0.5
            },
            annotation: {
              events: ["click"],
              annotations: [
                {
                  type: "line",
                  mode: "vertical",
                  scaleID: "x-axis-0",
                  value: 900,
                  endValue: "1997-09-01",
                  borderColor: "red",
                  label: {
                    content: "TODAY",
                    enabled: true,
                    position: "top"
                  },
                  onWhell: function(e) {
                    console.log("veio ou não");
                  }
                }
              ]
            },

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
hokiedspcommented, Oct 17, 2019

I had the same issue and using scaleID: "x-axis-1", rather than scaleID: "x-axis-0", solved my problem, FYI .

1reaction
kenmasumitsucommented, Nov 19, 2020

I experienced the similar issue.

In my solution is that converting this.options to pure JavaScript objects.

  mounted() {
    this.renderChart(this.chartdata, JSON.parse(JSON.stringify(this.options)));
  },

In my investigation, Vue returns data with [ob: Observer]. So that, initConfig() in chartjs-plugin-annotation did not work expectedly.

initConfig in helper.js

	function initConfig(config) {
		config = chartHelpers.configMerge(Chart.Annotation.defaults, config);
                 // Chart.Annotation.defaults is just JS object.
                 // config for the input is object with [__ob__: Observer].
                 // annotation elements are dropped in the return.  It is not expected result.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Vertical line does not show in geom_boxplot - Stack Overflow
In this answer: I've created a much bigger sample; I'm using yearmonth from tsibble for simplicity; I've solved the issue with the vertical...
Read more >
Add Vertical Lines To Excel Charts Like A Pro! [Guide]
There are a few creative ways to add a vertical line to your chart bouncing around the internet. If you have landed on...
Read more >
Solved: Vertical line not seen during mouse hover on the L...
Solved: Is it possible to add the vertical line on the Line and Clustered column chart when you hover mouse pointer over the...
Read more >
How to Insert a Horizontal or Vertical Line in Microsoft Word
2. Go to the Home tab and then click the dropdown arrow for the Borders option in the Paragraph group. 3. Select Horizontal...
Read more >
Missing vertical line in latex table - TeX - LaTeX Stack Exchange
I am using the below code for making a latex table. Unfortunately, when I compile the vertical line of last column is missing....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found