Skip to content

Commit

Permalink
feat: Add Images to Scatter Chart (#257)
Browse files Browse the repository at this point in the history
* Added images to scatter chart.

* Making a quick change to scatter chart to try and get the deploy to work.
  • Loading branch information
chadstewart committed Aug 23, 2022
1 parent 2e86e8f commit 20df419
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion stories/molecules/scatter-chart.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,49 @@ const testOptions = {
]
};

const testOptionsWithImage = {
xAxis: {},
yAxis: {},
series: [
{
symbolSize: 30,
symbol: (value: number[]) => value[0] > 8 ? "image://https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1064&q=80" : "circle",
data: [
[10.0, 8.04],
[8.07, 6.95],
[13.0, 7.58],
[9.05, 8.81],
[11.0, 8.33],
[14.0, 7.66],
[13.4, 6.81],
[10.0, 6.33],
[14.0, 8.96],
[12.5, 6.82],
[9.15, 7.2],
[11.5, 7.2],
[3.03, 4.23],
[12.2, 7.83],
[2.02, 4.47],
[1.05, 3.33],
[4.05, 4.96],
[6.03, 7.24],
[12.0, 6.26],
[12.0, 8.84],
[7.08, 5.82],
[5.02, 5.68]
],
type: "scatter"
}
]
};

// ScatterChart Template
const ScatterChartTemplate: ComponentStory<typeof ScatterChart> = (args) => <ScatterChart {...args} />;

// ScatterChart Default
export const Default = ScatterChartTemplate.bind({});
Default.args = { title: "Test Title", option: testOptions };
Default.args = { title: "Test Title", option: testOptions };

// ScatterChart with Images
export const WithImages = ScatterChartTemplate.bind({});
WithImages.args = { title: "Test Title", option: testOptionsWithImage };

0 comments on commit 20df419

Please sign in to comment.