Danniel Rodrigues
Danniel Rodrigues

Reputation: 3

NVD3 Line Chart not updating yAxis with forceY

I have a line chart with a margin between the lowest and highest price and the chart borders. I don't want the ticks touching the top and the bottom of the chart, so I used forceY to achieve that.

<nvd3-line-chart
data="sample_data"
id="sample_data"
height="350"
showXAxis="true"
forcey="{{y_axis_range}}"
showYAxis="true">
</nvd3-line-chart>

The data:

sample_data: [
 { 
  key: "PRODUCT 1",
  values: [ [ 0, 10.0 ] ] 
 },
 { 
  key: "PRODUCT 2",
  values: [ [ 0, 9.0 ] ] 
 }
],
y_axis_range: [ 8.0, 12.0 ]

The thing is, when I change the data, the graph seems to redraw correctly. The yAxis ticks are updated with highest values, but the values of the data, not the y_axis_range.

How to properly force the graph to have the tick range intended?

Upvotes: 0

Views: 244

Answers (0)

Related Questions