ankane / chartkick

Create beautiful JavaScript charts with one line of Ruby
https://chartkick.com
MIT License
6.33k stars 565 forks source link

xmax and xmin don't seem to be being carried through (ruby gem) #578

Closed fakeharxy closed 2 years ago

fakeharxy commented 2 years ago

Describe the bug It seems that when I use xmin and xmax, the values don't seem to be working - they do get passed through to chartkick (see attached images below) but it makes no difference... any thoughts on how to proceed?

HTML generated by Chartkick

<div id="chart-1"></div>
<script>
    var createChart = function() { new Chartkick["LineChart"]("chart-1", [{"name":"chart","data":[["2021-11-01",50000],["2021-11-02",48276],["2021-11-03",46552],["2021-11-04",44828],["2021-11-05",43104],["2021-11-06",41380],["2021-11-07",39656],["2021-11-08",37932],["2021-11-09",36208],["2021-11-10",34484],["2021-11-11",32760],["2021-11-12",31036],["2021-11-13",29312],["2021-11-14",27588],["2021-11-15",25864],["2021-11-16",24140],["2021-11-17",22416],["2021-11-18",20692],["2021-11-19",18968],["2021-11-20",17244],["2021-11-21",15520],["2021-11-22",13796],["2021-11-23",12072],["2021-11-24",10348],["2021-11-25",8624],["2021-11-26",6900],["2021-11-27",5176],["2021-11-28",3452],["2021-11-29",1728],["2021-11-30",4]],"color":"orange"}], {"colors":["blue","red","greenyellow","purple","burlywood","deeppink","gray","gold","lightseagreen"],"xmax":"2021-11-07","max":51500}); }
</script>
ankane commented 2 years ago

Hey @fakeharxy, thanks for reporting! It looks like this was missed when upgrading to Chart.js 3. Will push a new release shortly.

fakeharxy commented 2 years ago

To add an additional mystery, it seems to work on heroku, it just doesn't work locally?!?

ankane commented 2 years ago

I'm not sure how to reproduce the last part, but sounds like something else is probably going on.

fakeharxy commented 2 years ago

Yeah, I think some weird PICNIC going on here, I'm going to close this.

fakeharxy commented 2 years ago

Oh, it's already closed