add pattern draw fix
This commit is contained in:
parent
08e1ac65aa
commit
a0ee136d04
@ -13,7 +13,7 @@ import { Chart } from 'react-chartjs-2';
|
||||
import faker from 'faker';
|
||||
import { ChartView } from './ChartView';
|
||||
import ChartTitle from './ChartTitle';
|
||||
import pattern from 'patternomaly'
|
||||
import { draw } from 'patternomaly'
|
||||
|
||||
ChartJS.register(
|
||||
LinearScale,
|
||||
@ -118,7 +118,7 @@ export function LineBarChart({ title, subtitle, data1, data2, data3, label, red,
|
||||
type: 'bar' as const,
|
||||
label: dataset2? dataset2 : 'Dataset 2',
|
||||
backgroundColor: (value, ctx) => {
|
||||
return hashurado? parseInt(value.dataIndex+1) <= currentTime.getMonth()? '#C2D5FB' : pattern.draw('diagonal', '#C2D5FB') : '#C2D5FB'
|
||||
return hashurado? parseInt(value.dataIndex+1) <= currentTime.getMonth()? '#C2D5FB' : draw('diagonal', '#C2D5FB') : '#C2D5FB'
|
||||
},
|
||||
data: data3.map(value => value),
|
||||
},
|
||||
@ -127,7 +127,7 @@ export function LineBarChart({ title, subtitle, data1, data2, data3, label, red,
|
||||
label: dataset3? dataset3 : 'Dataset 2',
|
||||
// backgroundColor: '#255488',
|
||||
backgroundColor: (value, ctx) => {
|
||||
return hashurado? parseInt(value.dataIndex+1) <= currentTime.getMonth()? '#255488' : pattern.draw('diagonal', '#255488') : '#255488'
|
||||
return hashurado? parseInt(value.dataIndex+1) <= currentTime.getMonth()? '#255488' : draw('diagonal', '#255488') : '#255488'
|
||||
},
|
||||
data: data2.map(value => value),
|
||||
},
|
||||
|
||||
@ -12,7 +12,7 @@ import { Bar } from 'react-chartjs-2';
|
||||
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
||||
import { ChartView } from './ChartView';
|
||||
import ChartTitle from './ChartTitle';
|
||||
import pattern from 'patternomaly'
|
||||
import { draw } from 'patternomaly'
|
||||
|
||||
ChartJS.register(
|
||||
CategoryScale,
|
||||
@ -79,12 +79,12 @@ export function SingleBar({ title, subtitle, dataProps, label, dataset, dataset1
|
||||
label: dataset,
|
||||
data: dataProps.map(value => value),
|
||||
backgroundColor: (value, ctx) => {
|
||||
return year? label[value.dataIndex]<=currentTime.getFullYear().toString()? '#255488' : pattern.draw('diagonal', '#C2D5FB') : day? parseInt(label[value.dataIndex])<=currentTime.getDay()? '#255488' : pattern.draw('diagonal', '#C2D5FB') : null
|
||||
return year? label[value.dataIndex]<=currentTime.getFullYear().toString()? '#255488' : draw('diagonal', '#C2D5FB') : day? parseInt(label[value.dataIndex])<=currentTime.getDay()? '#255488' : draw('diagonal', '#C2D5FB') : null
|
||||
},
|
||||
},
|
||||
{
|
||||
label: dataset1,
|
||||
backgroundColor: pattern.draw('diagonal', '#C2D5FB')
|
||||
backgroundColor: draw('diagonal', '#C2D5FB')
|
||||
}
|
||||
],
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user