Skip to content

Commit

Permalink
Fix some doc tests issues
Browse files Browse the repository at this point in the history
  • Loading branch information
clementwanjau committed May 7, 2024
1 parent f780713 commit aa0f414
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ apexcharts-rs = {version="0.1", features=["yew-component"]}
```
and then in your code:

```rust
```ignorelang
use yew::prelude::*;
use apexcharts_rs::{ApexChartComponent, ChartType, ChartSeries, SeriesData};
use apexcharts_rs::prelude::{ApexChartComponent, ChartType, ChartSeries, SeriesData};
#[function_component(ApexChart)]
fn MyApp() -> Html {
Expand Down Expand Up @@ -125,7 +125,7 @@ To combine multiple series in a single chart, you can add more `ChartSeries` to
## Series Data
The `SeriesData` enum is used to represent the data points for the chart. The data points can be a single value or a tuple of two values. The data points can be represented as follows:
```
use apexcharts_rs::SeriesData;
use apexcharts_rs::prelude::SeriesData;
let data = SeriesData::Single(vec![6500, 6418, 6456, 6526, 6356, 6456]);
Expand Down
25 changes: 0 additions & 25 deletions src/bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,6 @@ extern "C" {
/// Once created using the `new()` method, the chart should be rendered on the page using the
/// `render()` method before performing any other operations. Failure to do so will result in
/// the subsequent operations not doing anything.
///
/// ## Usage
///
/// ```rust
/// use apexcharts_rs::prelude::{ApexChart, ChartOptions};
///
/// let options_str = r#"
/// {
/// "chart": {
/// "type": "line"
/// },
/// "series": [
/// {
/// "name": "Series 1",
/// "data": [30, 40, 35, 50, 49, 125]
/// }
/// ]
/// }"#;
/// let filename = "options.json";
/// std::fs::write(filename, options_str).unwrap();
/// let options = ChartOptions::from_file(filename);
/// //let chart = ApexChart::new(&options.into());
/// // chart.render("chart-id");
/// std::fs::remove_file(filename).unwrap();
/// ```
pub type ApexChart;

/// Create a new instance of the `ApexChart` type.
Expand Down

0 comments on commit aa0f414

Please sign in to comment.