Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib/components/echarts/line-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const LineChart: React.FC<ChartProps> = (props) => {
seriesData,
xAxisData,
yAxisName,
yAxisMax,
height,
width,
labelFormatter,
Expand Down Expand Up @@ -96,6 +97,9 @@ const LineChart: React.FC<ChartProps> = (props) => {
return {
...item,
...lineItemConfig,
// a series whose data marks isolated points (per-item symbol)
// opts back into symbol rendering
showSymbol: item.showSymbol ?? lineItemConfig.showSymbol,
smooth: smooth,
itemStyle: {
...lineItemConfig.itemStyle,
Expand Down Expand Up @@ -132,6 +136,7 @@ const LineChart: React.FC<ChartProps> = (props) => {
yAxis: {
...options.yAxis,
name: yAxisName,
max: yAxisMax ?? undefined,
Comment thread
gitlawr marked this conversation as resolved.
nameTextStyle: {
fontSize: 12,
align: 'right'
Expand All @@ -147,6 +152,7 @@ const LineChart: React.FC<ChartProps> = (props) => {
seriesData,
xAxisData,
yAxisName,
yAxisMax,
title,
smooth,
titleOptions,
Expand Down
3 changes: 3 additions & 0 deletions src/lib/components/echarts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export interface ChartProps {
smooth?: boolean;
color?: string;
yAxisName?: string;
// pins the y-axis ceiling (e.g. 100 for percentage charts); left
// unset, echarts scales the axis to the data
yAxisMax?: number;
stack?: string | false;
gaugeConfig?: {
radius?: string;
Expand Down