MainChart

A powerful chart widget which is able to display diverse chart types such as line, area, column, bar, and table, including tabs and filters.

Props

Name

Type

Default Value

Required

Description

vizType

string[]

no

The type of the visualization. Chart types are line, pie, column, column_timeseries, map, scatter, and table

data

Highcharts Data

yes

The data to feed the visualization

name

string

yes

The title name of the chart

description

string

no

This text will show up on hover

groups

Array<{name: string, actived?: boolean}>[]

no

The data groups associating the charts data. The groups will be display as tabs on the chart widget

xAxis

string

no

The value unit of the x axis of the chart

yAxis

string

no

The value unit of the y axis of the chart

colors

string | string[]

no

The colors for the chart plots, it could be a COLORS or an array of hex codes

width

number | string

'auto'

no

The width of the chart, default unit is px

height

number | string

300

no

The height of the chart, default unit is px

chartConfig

object

no

Additional Highcharts config to customize

Usage Example

import React from 'react'

import { Viz } from 'a10-gui-dgp-viz'

const { MainChart } = Viz
export const MyDashboard = () => {
  return (
    <MainChart
      name="MY CHART"
      data={{ series: [] }}
      vizType={['line', 'column', 'column_timeseries', 'bar', 'table', 'pie', 'map']}
      description="This is my chart"
      groups={[
        { name: 'TOTAL CONN', actived: true },
        { name: 'CURR CONN' },
        { name: 'THROUGHPUT' },
      ]}
      colors="cyan_to_green"
    />
  )
}

Data structure

Key

Type

Required

Description

series

HightCharts series data

yes

The chart series data

total

number | string

no

The total info

Example of data structure

{
  series: [{
    name: 'Sent',
    data: [
      [1546445142959000, 100],
      [1546445143959000, 200],
      [1546445144959000, 300],
    ]
  },{
    name: 'Received',
    data: [
      [1546445142959000, 800],
      [1546445143959000, 900],
      [1546445144959000, 1000],
    ]
  }],
  total: 3000,
}

Actions

VIZ.CHART.MAIN.SWITCH_TYPE

Name

Type

Description

type

string

The action type

chartType

string

The chart type to switch to

callback

(data: any, chartType: string): void

To update the viz with new data

Last updated

Was this helpful?