Add the ability to create line charts and more (with Chart Maker) #638
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add the ability to create line charts and more (with Chart Maker)
SeleniumBase Chart Maker allows you to create HTML charts with Python.
The HighCharts library is used for creating charts.
Here's a sample chart:
(Click on the image for an actual chart demo)
Here's how to run the example:
cd examples/chart_maker pytest my_chart.py
Creating a new chart:
If creating multiple charts at the same time, you can pass the
chart_name
parameter to distinguish between different charts.Adding a data point to a chart:
Adding a new data series to an existing chart:
Saving a chart to a file:
The full HTML of the chart is saved to the
saved_charts/
folder.Extracting the HTML of a chart:
Displaying a chart in the browser window:
All methods have the optional
chart_name
argument, which is only needed if you're creating multiple charts at the same time.Here's an example of using SeleniumBase Chart Maker:
This example is from my_chart.py, which you can run from the
examples/chart_maker
folder with the following command:For a more advanced example (multiple charts in a presentation):
Here's how to run that example:
cd examples/chart_maker pytest chart_presentation.py
(Press the Right Arrow to advance to the next slide in that chart presentation)
(Click to see a live example of that presentation)
Multi-Series charts can also be created. Try the available examples to learn more.
Also update Python dependencies: