Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions crates/office2pdf/src/ir/elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,44 @@ pub enum Block {
FloatingImage(FloatingImage),
List(List),
MathEquation(MathEquation),
Chart(Chart),
PageBreak,
}

/// A chart extracted from an embedded chart object.
#[derive(Debug, Clone)]
pub struct Chart {
/// The type of chart (bar, line, pie, etc.).
pub chart_type: ChartType,
/// Optional chart title.
pub title: Option<String>,
/// Category labels (x-axis or pie slice names).
pub categories: Vec<String>,
/// Data series.
pub series: Vec<ChartSeries>,
}

/// The type of chart.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ChartType {
Bar,
Column,
Line,
Pie,
Area,
Scatter,
Other(String),
}

/// A data series within a chart.
#[derive(Debug, Clone)]
pub struct ChartSeries {
/// Optional series name.
pub name: Option<String>,
/// Data values for this series.
pub values: Vec<f64>,
}

/// A math equation (from OMML or similar).
#[derive(Debug, Clone)]
pub struct MathEquation {
Expand Down
Loading