-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Highcharts plugin): fix colorAxis legend title color (#100)
* fix(Highcharts plugin): fix colorAxis legend title color * refactor: refactor column stories
- Loading branch information
Showing
7 changed files
with
125 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/plugins/highcharts/__stories__/column/VerticalStacked.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import {Story, Meta} from '@storybook/react'; | ||
import {Button} from '@gravity-ui/uikit'; | ||
import {ChartKit} from '../../../../components/ChartKit'; | ||
import {ChartKitRef} from '../../../../types'; | ||
import {settings} from '../../../../libs'; | ||
import {HighchartsPlugin} from '../../index'; | ||
import holidays from '../mocks/holidays'; | ||
import {data} from '../mocks/column-ver-stacked'; | ||
|
||
export default { | ||
title: 'Plugins/Highcharts/Column', | ||
component: ChartKit, | ||
} as Meta; | ||
|
||
const Template: Story<any> = () => { | ||
const [shown, setShown] = React.useState(false); | ||
const chartkitRef = React.useRef<ChartKitRef>(); | ||
|
||
if (!shown) { | ||
settings.set({plugins: [HighchartsPlugin], extra: {holidays}}); | ||
return <Button onClick={() => setShown(true)}>Show chart</Button>; | ||
} | ||
|
||
return ( | ||
<div style={{height: 300, width: '100%'}}> | ||
<ChartKit ref={chartkitRef} type="highcharts" data={data} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export const VerticalStacked = Template.bind({}); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import {HighchartsWidgetData} from '../../types'; | ||
|
||
export const data: HighchartsWidgetData = { | ||
data: { | ||
graphs: [ | ||
{ | ||
data: [ | ||
{ | ||
y: 50.55, | ||
color: 'rgb(255, 61, 9)', | ||
}, | ||
{ | ||
y: 80.45, | ||
color: 'rgb(255, 65, 9)', | ||
}, | ||
{ | ||
y: 100.34, | ||
color: 'rgb(255, 83, 9)', | ||
}, | ||
], | ||
name: 'Profit', | ||
}, | ||
{ | ||
data: [ | ||
{ | ||
y: 350.65, | ||
color: 'rgb(208, 189, 48)', | ||
}, | ||
{ | ||
y: 119.82, | ||
color: 'rgb(255, 95, 88)', | ||
}, | ||
{ | ||
y: 452.15, | ||
color: 'rgb(84, 165, 32)', | ||
}, | ||
], | ||
name: 'Sales', | ||
}, | ||
], | ||
categories: ['Furniture', 'Office Supplies', 'Technology'], | ||
}, | ||
config: { | ||
enableSum: true, | ||
precision: 2, | ||
}, | ||
libraryConfig: { | ||
chart: { | ||
type: 'column', | ||
}, | ||
legend: { | ||
title: { | ||
text: 'Measure Values', | ||
}, | ||
enabled: true, | ||
}, | ||
colorAxis: { | ||
startOnTick: false, | ||
endOnTick: false, | ||
min: 50.55, | ||
max: 452.72057380654326, | ||
stops: [ | ||
[0, 'rgb(255, 61, 100)'], | ||
[0.5, 'rgb(255, 198, 54)'], | ||
[1, 'rgb(84, 165, 32)'], | ||
], | ||
}, | ||
plotOptions: { | ||
column: { | ||
maxPointWidth: 50, | ||
}, | ||
}, | ||
enableSum: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters