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

v.2 Line chart not showing point when only 1 y-axis label and data point. #2622

Closed
tejclark opened this issue May 24, 2016 · 3 comments
Closed

Comments

@tejclark
Copy link

Apologies if this has been raised before, I had a search but couldn't find anything on version 2.

I'm getting a similar problem to #76 but on v.2. When I only pass in 1 data point and 1 label for the x-axis, the data point isn't drawn on the graph and the x-axis (time type) label is off #the screen (top left - see screen shot below).

screen shot 2016-05-24 at 17 44 49

Data used:

data: {
labels: ["2016-06-20"],
datasets: [{
type: 'line',
data: [3],
borderColor: "#393f4f",
pointBorderColor: "#393f4f",
pointBackgroundColor: "#393f4f",
fill: false,
tension: 0,
lineTension: 0,
pointBorderWidth: 1,
pointRadius: 5,
pointHoverRadius: 5
}]
}

Here's my xAxes:

xAxes: [{
id: "date_axis",
type: "qids",
time: {
unit: 'day',
displayFormats: {
'day': 'YYYY-MM-DD'
}
},
gridLines: {
display: false
},
}]

yAxes:

yAxes: [
{
type: "linear",
position: "left",
ticks: {
reverse: true,
min: 0,
max: 4,
stepSize: 1,
callback: function(value, index, values) {
if (index < 4) {
return index;
}
return null;
}
}
}]

@tejclark
Copy link
Author

Here's a jsbin of the error (using 2.1.4):

http://jsbin.com/gabiqowali/1/edit?html,js,output

Passing in a second label (even without a data point) fixes the issue: http://jsbin.com/giguhogodi/2/edit?html,js,output

@IvanRF
Copy link

IvanRF commented Jun 6, 2016

+1
I'm having the same issue for one entry

fulldecent added a commit that referenced this issue Jun 27, 2016
time type xAxis height crah in line chart #2622
@etimberg
Copy link
Member

etimberg commented Sep 8, 2016

Fixed in later versions http://jsbin.com/dapoyexuti/1/edit?html,js,output

@etimberg etimberg closed this as completed Sep 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants