diff --git a/README.md b/README.md index b8ea36b..14bf09e 100644 --- a/README.md +++ b/README.md @@ -96,11 +96,11 @@ It is important then, that you know which variables are being parsed to the func segment: Segment { borderColor: FnWithArgs::new() // Create the Function - .arg("ctx") // Add a named arguement using a builder pattern + .arg("ctx") // Add a named argument using a builder pattern .body("ctx.p0.parsed.y > ctx.p1.parsed.y ? 'red' : 'green'") // Add the function body, in this case make the line red if the slope is negative } } ] } } -``` \ No newline at end of file +``` diff --git a/src/utils.rs b/src/utils.rs index 2a3a33e..e7cafe7 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -54,6 +54,9 @@ impl Chart { let dash = Reflect::get(&segment, &"borderDash".into()); if let Ok(dash) = dash { + if dash == JsValue::UNDEFINED { + return; + } Reflect::set( &segment, &"borderDash".into(), @@ -66,6 +69,9 @@ impl Chart { let color = Reflect::get(&segment, &"borderColor".into()); if let Ok(color) = color { + if color == JsValue::UNDEFINED { + return; + } Reflect::set( &segment, &"borderColor".into(),