jettro / c3-angular-directive

Contains angularjs directives that use c3js to create good looking graphs
http://jettro.github.io/c3-angular-directive/
MIT License
203 stars 98 forks source link

range-mix and range-max attribute in chart-axis doesnt work #163

Closed szymongaertig closed 6 years ago

szymongaertig commented 7 years ago

range-mix and range-max attribute in chart-axis doesnt work

in example of axis-y-directive usage we have:

   <chart-axis>
     <chart-axis-y axis-id="y"
                 axis-position="outer-right"
                 axis-label="Higher numbers"
                 padding-top="100"
                 padding-bottom="0"
                 range-min="0"/>
     <chart-axis-y axis-id="y2"
                 axis-position="outer-right"
                 axis-label="Lower numbers"
                 padding-top="10"
                 padding-bottom="0"
                 range-max="100"
                 range-min="0"/>
  </chart-axis>

but in source code of directive:

  var axisMax = attrs.axisMax;
        var axisMin = attrs.axisMin;
        if (axisMax) {
            axis.max = parseInt(axisMax);
        }
        if (axisMin) {
            axis.min = parseInt(axisMin);
        }

To set proper max and min value of y axis we need to use axis-min and axis-max attribute.

jettro commented 6 years ago

I think the documentation is wrong and not the code.