import React from 'react' ; import { AreaSeries , Axis , Chart , CurveType , Position , ScaleType , Settings , timeFormatter } from '@elastic/charts' ; import { KIBANA_METRICS } from '@elastic/charts/src/utils/data_samples/test_dataset_kibana' ; import { useBaseTheme } from '../../use_base_theme' ; const dateFormatter = timeFormatter ( 'HH:mm' ) ; export const Example = ( ) => { const data = KIBANA_METRICS . metrics . kibana_os_load [ 0 ] . data . map ( ( d ) => ( d [ 1 ] < 7 ? [ d [ 0 ] , null ] : [ d [ 0 ] , d [ 1 ] - 10 ] ) ) ; return ( < Chart > < Settings baseTheme = { useBaseTheme ( ) } / > < Axis id = "bottom" title = "index" position = { Position . Bottom } tickFormat = { dateFormatter } / > < Axis id = "left" title = { KIBANA_METRICS . metrics . kibana_os_load [ 0 ] . metric . title } position = { Position . Left } tickFormat = { ( d ) => Number ( d ) . toFixed ( 2 ) } /> < AreaSeries id = "areas" xScaleType = { ScaleType . Linear } yScaleType = { ScaleType . Log } xAccessor = { 0 } yAccessors = { [ 1 ] } data = { data } curve = { CurveType . CURVE_MONOTONE_X } / > < /Chart>); } ;