Comments (11)
Stroke width is a newly added feature in 0.2.6
You should be able to use it as following:
LineSeries::new( ...., Into<ShapeStyle>::into(&RED).stroke_width(2))
from plotters.
error[E0277]: the trait bound `plotters::style::ShapeStyle: plotters::style::color::SimpleColor` is not satisfied
--> src\scenes\instances\components\chart\mod.rs:186:17
|
186 | &Into::<ShapeStyle>::into(&RED).stroke_width(2),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `plotters::style::color::SimpleColor` is not implemented for `plotters::style::ShapeStyle`
|
= note: required because of the requirements on the impl of `plotters::style::color::Color` for `plotters::style::ShapeStyle`
= note: required because of the requirements on the impl of `std::convert::From<&plotters::style::ShapeStyle>` for `plotters::style::ShapeStyle`
= note: required because of the requirements on the impl of `std::convert::Into<plotters::style::ShapeStyle>` for `&plotters::style::ShapeStyle`
= note: required by `plotters::series::line_series::LineSeries::<Coord, I>::new`
from plotters.
Remove the leading and sign would fix this.
Cause &impl Color
can be converted to shape style. as long as you are passing a shape style anyway, you don't need to borrow.
from plotters.
bingo!
from plotters.
But in draw_line() func i'm still getting 1!
fn draw_line<S: BackendStyle>(
&mut self,
from: BackendCoord,
to: BackendCoord,
style: &S,
) -> Result<(), DrawingErrorKind<Self::ErrorType>> {
if style.as_color().alpha() == 0.0 {
return Ok(());
}
let stroke_width = style.stroke_width() as u8;
from plotters.
from plotters.
But in draw_line() func i'm still getting 1!
Nop, this is the default impelentation
This is where it passes through
from plotters.
I see it, but i cant pull out custom stroke_width from BackendStyle struct.
from plotters.
Resolved, its working as expected. Sorry for your time.
from plotters.
No problem. Let me know if you have other questions
from plotters.
I'm having trouble setting a stroke width as well. Does the wasm/canvas backend support setting a stroke width? That's the backend that I've been trying.
from plotters.
Related Issues (20)
- Ability to save figures in the same way you can in rust in a notebook environment. HOT 3
- [BUG] currently nightly compiler cannot build plotters due to bug in pathfinder (simd) HOT 11
- [BUG] Even your own Examples doesn't work HOT 3
- [BUG] Drawing series can hang under certain conditions HOT 7
- [BUG] Can't outline/stroke polygon for svg HOT 1
- [BUG] example crash under centos 7.5 HOT 1
- [BUG] plotters-canvas build error
- plotters v0.3.5 has RUSTSEC-2023-0020 from font-kit v0.11.0 HOT 2
- [BUG] titled function draw text position error when generating PNG file HOT 3
- [BUG] unsafe preconditions violated HOT 12
- default font size?
- [BUG] Spacing between words removed HOT 1
- Step charts
- [BUG] 'static lifetime requirement for `ChartContext`
- pie RGBAcolor
- Warning due to use of deprecated default_features HOT 1
- [BUG] AsRangedCoord not implemented for Range<NaiveDateTime>
- Drawing 3d Voxels
- [BUG] Time for axes does not work on single day with different hours
- [Feature Request] Stroke width/outline for text in bitmap backend
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plotters.