Interpolation Modes

    config setup

    1. const labels = [];
    2. for (let i = 0; i < DATA_COUNT; ++i) {
    3. labels.push(i.toString());
    4. }
    5. const datapoints = [0, 20, 20, 60, 60, 120, NaN, 180, 120, 125, 105, 110, 170];
    6. const data = {
    7. labels: labels,
    8. datasets: [
    9. data: datapoints,
    10. borderColor: Utils.CHART_COLORS.red,
    11. fill: false,
    12. cubicInterpolationMode: 'monotone',
    13. tension: 0.4
    14. }, {
    15. label: 'Cubic interpolation',
    16. data: datapoints,
    17. tension: 0.4
    18. }, {
    19. label: 'Linear interpolation (default)',
    20. data: datapoints,
    21. borderColor: Utils.CHART_COLORS.green,
    22. fill: false
    23. }
    24. ]