How to use tui-chart - 10 common examples

To help you get started, we’ve selected a few tui-chart examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nhn / tui.chart / test / types / comboChart.ts View on Github external
},
    theme: 'theme5'
};

tuiChart.registerTheme('theme5', {
    series: {
        area: {
            colors: ['#ffb840']
        },
        line: {
            colors: ['#785fff']
        }
    }
});

const lineAreaComboChart = tuiChart.comboChart(elLineAreaCombo, lineAreaRowData, lineAreaComboOptions);
console.group('LineAreaComboChart');
console.log(lineAreaComboChart);
console.log('chartType: ', lineAreaComboChart.chartType);
console.log('chartTypes: ', lineAreaComboChart.chartTypes);
console.log('className : ', lineAreaComboChart.className);
console.log('getCheckedLegend : ', lineAreaComboChart.getCheckedLegend());
console.groupEnd();

// LineScatterComboChart
const elLineScatterCombo = document.querySelector('.section[data-section="chart"] .lineScatterCombo');

const theme6 = {
    series: {
        scatter: {
            colors: ['#ffb840']
        },
github nhn / tui.chart / test / types / comboChart.ts View on Github external
yAxis: {
        title: 'Percentage (%)'
    },
    xAxis: {
        title: 'Temperature (C)'
    },
    series: {
        line: {
            spline: true
        }
    }
};

(lineScatterOptions as any).theme = 'theme6';

const lineScatterChart = tuiChart.comboChart(elLineScatterCombo, lineScatterData, lineScatterOptions);
console.group('LineScatterComboChart');
console.log(lineScatterChart);
console.log('chartType: ', lineScatterChart.chartType);
console.log('chartTypes: ', lineScatterChart.chartTypes);
console.log('className : ', lineScatterChart.className);
console.log('getCheckedLegend : ', lineScatterChart.getCheckedLegend());
console.groupEnd();

// PieDonutComboChart
const elPieDonutCombo = document.querySelector('.section[data-section="chart"] .pieDonutCombo');

const data2 = {
    categories: ['Browser'],
    seriesAlias: {
        pie1: 'pie',
        pie2: 'pie'
github nhn / tui.chart / test / types / comboChart.ts View on Github external
// LineScatterComboChart
const elLineScatterCombo = document.querySelector('.section[data-section="chart"] .lineScatterCombo');

const theme6 = {
    series: {
        scatter: {
            colors: ['#ffb840']
        },
        line: {
            colors: ['#785fff']
        }
    }
};

tuiChart.registerTheme('theme6', theme6);

const lineScatterData = {
    series: {
        scatter: [
            {
                name: 'Efficiency',
                data: [
                    { x: 10, y: 20 },
                    { x: 14, y: 30 },
                    { x: 18, y: 10 },
                    { x: 20, y: 30 },
                    { x: 24, y: 15 },
                    { x: 25, y: 25 },
                    { x: 26, y: 5 },
                    { x: 30, y: 35 },
                    { x: 34, y: 15 },
github meetzaveri / react-donut / src / lib / tui-wrapper.js View on Github external
showLabel: this.props.showChartLabel
      },
      tooltip: {
        suffix: "%"
      },
      legend: {
        align: this.props.legendAlignment
      }
    };
    var theme = this.props.chartThemeConfig;
    // tui.chart.registerTheme('newTheme', theme);
    // For apply theme
    tui.registerTheme("myTheme", theme);
    options.theme = "myTheme";

    tui.pieChart(container, data, options);
  }
github nhn / tui.chart / test / types / comboChart.ts View on Github external
pointOnColumn: true
    },
    xAxis: {
        title: 'Month',
        tickInterval: 'auto'
    },
    series: {
        zoomable: true
    },
    tooltip: {
        suffix: 'kWh'
    },
    theme: 'theme5'
};

tuiChart.registerTheme('theme5', {
    series: {
        area: {
            colors: ['#ffb840']
        },
        line: {
            colors: ['#785fff']
        }
    }
});

const lineAreaComboChart = tuiChart.comboChart(elLineAreaCombo, lineAreaRowData, lineAreaComboOptions);
console.group('LineAreaComboChart');
console.log(lineAreaComboChart);
console.log('chartType: ', lineAreaComboChart.chartType);
console.log('chartTypes: ', lineAreaComboChart.chartTypes);
console.log('className : ', lineAreaComboChart.className);
github nhn / tui.chart / test / types / comboChart.ts View on Github external
xAxis: {
        title: 'Month'
    },
    series: {
        line: {
            showDot: true
        }
    },
    tooltip: {
        grouped: true,
        suffix: 'Β°C'
    }
};


const columnNLineChart = tuiChart.comboChart(elColumnLineCombo, data, columnAndLineOptions);
console.group('ColumnLineChart');
console.log(columnNLineChart);
console.log('chartType: ', columnNLineChart.chartType);
console.log('chartTypes: ', columnNLineChart.chartTypes);
console.log('className : ', columnNLineChart.className);
console.log('yAxisOptions : ', columnNLineChart.yAxisOptions);
console.log('getCheckedLegend : ', columnNLineChart.getCheckedLegend());
console.groupEnd();

columnNLineChart.addPlotBand({
    range: [['Aug', 'Sep']],
    color: '#48a0ff',
    opacity: 0.15
});
columnNLineChart.addPlotLine({
    value: 'Sep',
github nhn / tui.chart / test / types / comboChart.ts View on Github external
pie2: {
            radiusRange: ['70%', '100%'],
            labelAlign: 'outer',
            showLegend: true
        }
    },
    legend: {
        visible: true
    },
    tooltip: {
        suffix: '%'
    },
    theme: 'theme3'
};

const pieNDonutChart = tuiChart.comboChart(elPieDonutCombo, data2, pieNDonutOptions);
console.group('PieDonutComboChart');
console.log(pieNDonutChart);
console.log('chartType: ', pieNDonutChart.chartType);
console.log('chartTypes: ', pieNDonutChart.chartTypes);
console.log('className : ', pieNDonutChart.className);
console.log('getCheckedLegend : ', pieNDonutChart.getCheckedLegend());
console.groupEnd();
github nhn / tui.chart / test / types / mapChart.ts View on Github external
const mapOptions = {
    chart: {
        width: 900,
        height: 700,
        title: 'Population density of World (per ㎒)',
        format: '0.00'
    },
    map: 'world',
    legend: {
        align: 'bottom'
    },
    theme: 'theme4'
};

const mapChart = tuiChart.mapChart(elMap, data, mapOptions);
mapChart.chartType;
mapChart.className;

mapChart.on('load', () => {
    mapChart.addData('Jan', [2000, 4000, 6000, 8000]);
});
mapChart.resetTooltipAlign();
mapChart.resetTooltipOffset();
mapChart.resetTooltipPosition();
mapChart.resize({
    width: 500,
    height: 400,
});
mapChart.setTooltipAlign('right bottom');
mapChart.setTooltipOffset({
    x: 50,
github nhn / tui.chart / test / types / mapChart.ts View on Github external
import tuiChart from 'tui-chart';

tuiChart.registerMap('newMap', [
    {
        code: 'KR',
        name: 'South Korea',
        path: 'M835.13,346.53L837.55,350.71...',
        labelCoordinate: {
          x: 0.6,
          y: 0.7
        }
    }
]);

const elMap = document.querySelector('.section[data-section="chart"] .map');

const data = {
    series: [
        {
github nhn / toast-ui.react-chart / stories / barChart / barChart.stories.js View on Github external
const Story = () => {
    if (theme === themeOptions.myTheme) {
      TuiChart.registerTheme('myTheme', myTheme);
      options.theme = 'myTheme';
    }

    return ;
  };