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

Implement color.threshold #69

Open eMuonTau opened 9 years ago

eMuonTau commented 9 years ago

Can you implement color.threshold for gauges?

C3 Documentation at http://c3js.org/reference.html#color-threshold is not complete but here is a working example http://c3js.org/samples/chart_gauge.html.

@mdavid5 already implemented values property of this feature #68 but unit and max properties are missing.

jettro commented 8 years ago

Hi @noderino I am looking into this. Do you know by any chance if this configuration is specific to the Gauge? At the moment I have a color directive, but I am not sure whether this should be a generic feature or not. Based on the link you provided I would have to add support for this type of configuration:

color: {
        pattern: ['#FF0000', '#F97600', '#F6C600', '#60B044'], // the three color levels for the percentage values.
        threshold: {
//            unit: 'value', // percentage is default
//            max: 200, // 100 is default
            values: [30, 60, 90, 100]
        }
    }
stevezau commented 8 years ago

@jettro I'm also looking for this feature.. In fact I'd like to set dynamic thresholds (min/max) via the controller as well.. At the moment it appears you can only set static via http://jettro.github.io/c3-angular-directive/api-docs/0.7/chartGauge.html

eMuonTau commented 8 years ago

Hi @jettro, "color.threshold" is specific to gauge chart. With commit https://github.com/jettro/c3-angular-directive/commit/4a8e40ae0411bea738e9c2756a416aa8bc2651f7 "color.threshold.values" property seems to be implemented correctly. I did not test it. We only need "color.threshold.unit" and color.threshold.max" properties.

jettro commented 8 years ago

Need to check the status in new c3 release and come with an example if it is possible.

ShivPandey commented 7 years ago

can we also changes in title part in angularjs file?

ShivPandey commented 7 years ago

<chart-donut width="60" title="Attendance"/> how to change title or other config in angularjs controller