Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vline symbols not showing on chart #545

Open
anani112 opened this issue Jun 25, 2017 · 1 comment
Open

vline symbols not showing on chart #545

anani112 opened this issue Jun 25, 2017 · 1 comment

Comments

@anani112
Copy link

I'm currently trying to add a vertical line to my chart using the symbols but I can't see any vertical line on my chart. I tested with horizontal lines and those are working as expected. I'm using release 2.0.28

Config:

var chartOptions = {
            axes: {
                x: { key: 'x', type: 'date', ticksInterval: 60 * 24 },
                y: { type: 'linear' }
            },
            grid: {
                x: false,
                y: true
            },
            symbols: [{
                type: 'vline',
                value: new Date("2017-06-21T04:29:06.000Z"),
                color: '#ed4b3a'
            },
            {
                type: 'hline',
                value: 80000,
                color: '#ed4b3a',
                axis: 'y'
            }],
            series: [
              ...
            ],
            drawDots: false
        };

This is a screenshot of what I'm seeing: you can see the horizontal line but no vertical line (I even edited the CSS to change with size of both lines but only the hline is visible and changes size)

image

Let me know if there is anything I'm doing wrong

@anani112 anani112 changed the title vline symbols not working vline symbols not showing on chart Jul 10, 2017
@anani112
Copy link
Author

anani112 commented Nov 7, 2017

found the cause of the problem i was facing.

It turns out when parsing the VLine options, the library expects a number (see

this.value = Options.getNumber(js.value, 0);
)

However when that x-axis is of the 'date' type, one would expect the VLine value to also be a date. To fix this issue I converted my date object to a number using the Date().getTime() function and now the line shows up as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant