Skip to content

Commit

Permalink
[fix]Add new params renderMode, support screenshot. #128
Browse files Browse the repository at this point in the history
  • Loading branch information
supervons committed Aug 12, 2024
1 parent 6514413 commit bddeda2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare function RNEChartsPro(props: {
ref?:object;
fontFamilies?: Array<object>;
themeName?: string;
renderMode?: string;
extension?: object;
customMapData?: object;
webViewSettings?: any;
Expand Down
4 changes: 3 additions & 1 deletion src/components/Echarts/renderChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export default function renderChart(props) {
echarts.registerMap('world', ${JSON.stringify(
props.customMapData || getMapJSON(props?.option?.geo?.length)
)});
const myChart = echarts.init(eChartsContainer, '${props.themeName}');
const myChart = echarts.init(eChartsContainer, '${
props.themeName
}',{ renderer: '${props.renderMode ? props.renderMode : "canvas"}' });
// The function created by "new Function" cannot access outer scope variables,
// so declare "formatterVariable" as a global value when without "let", "const" or "var" defined.
${enableParseStringFunction ? "" : "let "}formatterVariable = ${toString(
Expand Down

0 comments on commit bddeda2

Please sign in to comment.