import React, { Fragment, useContext } from 'react'; import { Button, Card, CardBody, Row, Col } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import ReactEchartsCore from 'echarts-for-react/lib/core'; import echarts from 'echarts/lib/echarts'; import PageHeader from '../common/PageHeader'; import FalconCardHeader from '../common/FalconCardHeader'; import FalconEditor from '../common/FalconEditor'; import AppContext from '../../context/Context'; import { themeColors, getPosition, getGrays, rgbaColor } from '../../helpers/utils'; const EchartCode = `function echartBarExample() { const data = [6000, 10000, 7500, 4000, 3500, 5500, 6000]; const yMax = Math.max(...data); const dataBackground = data.map(() => yMax); const getOption = (data, dataBackground, isDark) => { const grays = getGrays(isDark); return { tooltip: { trigger: 'axis', padding: [7, 10], formatter: '{b1}: {c1}', backgroundColor: grays.white, borderColor: grays['300'], borderWidth: 1, textStyle: { color: themeColors.dark }, transitionDuration: 0, position(pos, params, dom, rect, size) { return getPosition(pos, params, dom, rect, size); } }, xAxis: { type: 'category', data: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], boundaryGap: false, axisLine: { show: false }, axisLabel: { show: false }, axisTick: { show: false }, axisPointer: { type: 'none' } }, yAxis: { type: 'value', splitLine: { show: false }, axisLine: { show: false }, axisLabel: { show: false }, axisTick: { show: false }, axisPointer: { type: 'none' } }, series: [ { type: 'bar', barWidth: '5px', barGap: '-100%', itemStyle: { color: grays['200'], barBorderRadius: 10 }, data: dataBackground, animation: false, emphasis: { itemStyle: { color: grays['200'] } } }, { type: 'bar', barWidth: '5px', itemStyle: { color: themeColors.primary, barBorderRadius: 10 }, data: data, emphasis: { itemStyle: { color: themeColors.primary } }, z: 10 } ], grid: { right: 5, left: 10, top: 0, bottom: 0 } }; }; return ( ) }`; const lineChartCode = `function linechartExample(){ const totalOrderData= [15000, 43400]; const getOption = (totalOrderData, isDark) => { const grays = getGrays(isDark); return { tooltip: { triggerOn: 'mousemove', trigger: 'axis', padding: [7, 10], formatter: '{b0}: {c0}', backgroundColor: grays.white, borderColor: grays['300'], borderWidth: 1, transitionDuration: 0, position(pos, params, dom, rect, size) { return getPosition(pos, params, dom, rect, size); }, textStyle: { color: themeColors.dark } }, xAxis: { type: 'category', data: ['Week 4', 'Week 5'], boundaryGap: false, splitLine: { show: false }, axisLine: { show: false, lineStyle: { color: grays['300'], type: 'dashed' } }, axisLabel: { show: false }, axisTick: { show: false }, axisPointer: { type: 'none' } }, yAxis: { type: 'value', splitLine: { show: false }, axisLine: { show: false }, axisLabel: { show: false }, axisTick: { show: false }, axisPointer: { show: false } }, series: [ { type: 'line', lineStyle: { color: themeColors.primary, width: 3 }, itemStyle: { color: grays['100'], borderColor: themeColors.primary, borderWidth: 2 }, hoverAnimation: true, data: totalOrderData, connectNulls: true, smooth: 0.6, smoothMonotone: 'x', symbol: 'circle', symbolSize: 8, areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: rgbaColor(themeColors.primary, 0.25) }, { offset: 1, color: rgbaColor(themeColors.primary, 0) } ] } } } ], grid: { bottom: '2%', top: '0%', right: '10px', left: '10px' } }; }; return ( ) };`; const Echarts = () => { const { isDark } = useContext(AppContext); return (

Weekly Sales

Total Order

{/* */}
); }; export default Echarts;