forked from ddrilling/asb_cloud_front
Добавлен проп для установки дэша
This commit is contained in:
parent
cce35f32ef
commit
4ccab4dec5
@ -39,6 +39,7 @@ export const renderLine = <DataType extends Record<string, unknown>>(
|
|||||||
.transition()
|
.transition()
|
||||||
.duration(chart.animDurationMs ?? 0)
|
.duration(chart.animDurationMs ?? 0)
|
||||||
.attr('d', line(data as any))
|
.attr('d', line(data as any))
|
||||||
|
.attr('stroke-dasharray', String(chart.dash ?? ''))
|
||||||
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ export const renderNeedle = <DataType extends Record<string, unknown>>(
|
|||||||
.attr('x2', (d: any) => xAxis(chart.x(d)))
|
.attr('x2', (d: any) => xAxis(chart.x(d)))
|
||||||
.attr('y1', height - offset.bottom - offset.top)
|
.attr('y1', height - offset.bottom - offset.top)
|
||||||
.attr('y2', (d: any) => yAxis(chart.y(d)))
|
.attr('y2', (d: any) => yAxis(chart.y(d)))
|
||||||
|
.attr('stroke-dasharray', String(chart.dash ?? ''))
|
||||||
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ export type BaseChartDataset<DataType> = {
|
|||||||
animDurationMs?: number
|
animDurationMs?: number
|
||||||
point?: Omit<PointChartDataset, 'type'>
|
point?: Omit<PointChartDataset, 'type'>
|
||||||
afterDraw?: (d: any) => void
|
afterDraw?: (d: any) => void
|
||||||
|
dash?: string | number | [string | number, string | number]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type LineChartDataset = {
|
export type LineChartDataset = {
|
||||||
|
@ -107,12 +107,13 @@ const plugins = {
|
|||||||
cursor: { enabled: false }
|
cursor: { enabled: false }
|
||||||
}
|
}
|
||||||
|
|
||||||
const makeDataset = (key, label, color, width, radius) => ({
|
const makeDataset = (key, label, color, width, radius, dash) => ({
|
||||||
key,
|
key,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
label,
|
label,
|
||||||
color,
|
color,
|
||||||
width,
|
width,
|
||||||
|
dash,
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'linear',
|
type: 'linear',
|
||||||
accessor: 'depth',
|
accessor: 'depth',
|
||||||
@ -173,7 +174,7 @@ const Tvd = memo(({ idWell: wellId, title, ...other }) => {
|
|||||||
return [
|
return [
|
||||||
makeDataset('withoutNpt', 'Факт без НПВ', '#548CFF', 2, radius),
|
makeDataset('withoutNpt', 'Факт без НПВ', '#548CFF', 2, radius),
|
||||||
makeDataset('plan', 'План', '#EB5353', 2, radius),
|
makeDataset('plan', 'План', '#EB5353', 2, radius),
|
||||||
makeDataset('predict', 'Прогноз', '#BD4291', 1, radius),
|
makeDataset('predict', 'Прогноз', '#BD4291', 1, radius, [5, 5]),
|
||||||
makeDataset('fact', 'Факт', '#36AE7C', 2, radius),
|
makeDataset('fact', 'Факт', '#36AE7C', 2, radius),
|
||||||
]
|
]
|
||||||
}, [pointsEnabled])
|
}, [pointsEnabled])
|
||||||
|
Loading…
Reference in New Issue
Block a user