mirror of
https://github.com/storytold/gridcraft.git
synced 2026-12-02 02:33:55 -06:00
Merge branch 'main' into PR #684
# Conflicts: # crates/xlsx/src/chart.rs # crates/xlsx/src/read.rs
This commit is contained in:
@@ -334,7 +334,15 @@ pub(super) fn chart_set(s: &mut Session, p: &Json) -> Result<Json> {
|
||||
let sh = cx.sheet_mut(si)?;
|
||||
let Some(c) = sh.charts.get_mut(ci) else { return Ok(Json::Null) };
|
||||
if let Some(t) = str_param(p, "type") {
|
||||
c.kind = chart_kind(t, str_param(p, "subtype").unwrap_or(""));
|
||||
let kind = chart_kind(t, str_param(p, "subtype").unwrap_or(""));
|
||||
// A new type (other than a combo) applies to every series, as choosing it did before
|
||||
// series kept their own: their markers or lines from a file go with the old type.
|
||||
if kind != c.kind && kind != ChartKind::Combo {
|
||||
for series in &mut c.series {
|
||||
series.kind = None;
|
||||
}
|
||||
}
|
||||
c.kind = kind;
|
||||
if !c.supports_data_table() {
|
||||
c.data_table = None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user