Update links.

This commit is contained in:
Jim Myers 2019-03-01 12:38:02 -05:00
parent 0411a6742d
commit 68796ce9bb
4 changed files with 42 additions and 33 deletions

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>flipside.js</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="flipside-v1.9.0.js"></script>
<script src="flipside-v1.10.0.js"></script>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,

View File

@ -1,6 +1,6 @@
{
"name": "flipside-js",
"version": "1.9.0",
"version": "1.10.0",
"description": "FlipsideJS provides a library embeddable widgets that display data from the Flipside Platform API, including FCAS.",
"main": "index.js",
"scripts": {

View File

@ -72,35 +72,6 @@ export const DEFAULT_HIGHCHARTS: Highcharts.Options = {
} as any
},
inputEnabled: false
},
exporting: {
enabled: true,
buttons: {
contextButton: {
verticalAlign: "top",
x: 0,
y: 0,
color: "#ffffff",
symbolFill: "#ffffff",
theme: {
fill: "transparent",
cursor: "pointer",
states: { hover: { fill: "transparent", opacity: 0.7 } }
},
menuItems: [
"downloadCSV",
"separator",
"printChart",
"separator",
"downloadPNG",
"downloadJPEG",
"downloadPDF",
"downloadSVG"
]
}
}
}
};

View File

@ -28,11 +28,13 @@ export type Props = {
endDate?: string;
series: ChartSeries[];
api: API;
exportingEnabled?: boolean;
};
class Chart extends Component<Props> {
static defaultProps: Partial<Props> = {
axisTitles: []
axisTitles: [],
exportingEnabled: false
};
container: HTMLElement;
@ -127,15 +129,51 @@ class Chart extends Component<Props> {
},
rest
);
if (this.props.exportingEnabled) {
options.exporting = {
enabled: true,
buttons: {
contextButton: {
verticalAlign: "bottom",
horizontalAlign: "right",
x: 0,
y: 0,
color: "#ffffff",
symbolFill: "#ffffff",
theme: {
fill: "transparent",
cursor: "pointer",
states: { hover: { fill: "transparent", opacity: 0.7 } }
},
menuItems: [
"downloadCSV",
"separator",
"printChart",
"separator",
"downloadPNG",
"downloadJPEG",
"downloadPDF",
"downloadSVG"
]
}
}
};
} else {
options.exporting = { enabled: false };
}
Highcharts.chart(options);
}
render() {
return (
<div className={css.wrapper}>
<CustomLinks
widget="chart"
api={this.props.api}
style={{ display: "block", textAlign: "right" }}
/>
<div ref={el => (this.container = el)} />
<CustomLinks widget="chart" api={this.props.api} />
</div>
);
}