Comments (3)
Hi,
The issue here is that the font size is being set after the drawing logic has taken place. The fact they line up with the ticks is just a coincidence. Unfortunately there isn't a really good way of setting this in-line, I think we need to start exposing font properties through dimple but in the meantime you can work around this by adding some css to set the font size with the !Important modifier. This will override Dimple's in-line sizing and because it is applied before the drawing, Dimple should still manage positioning correctly.
In your example just add some css at the top:
<style>
text {
font-size: 12 !Important;
}
</style>
and remove the following from your script:
svg.selectAll("text")
.style("font-size", "12px");
I've just tried it and it's rendering correctly. Your approach makes perfect sense and is actually how I originally imagined people setting this kind of property, but it doesn't quite work with fonts due to dimple's reliance on them for positioning. Leave this issue open because I still think this needs to be addressed in the codebase.
Thanks
John
from dimple.
That looks much better, thankyou!
from dimple.
Font size properties added v2.0.0
from dimple.
Related Issues (20)
- Using CSV as data source HOT 3
- getComputedTextLength and getBbox not working on dimple node
- Cannot get y-axis to look like the standard graph
- dimple js not ploting the bar graph
- Wish: ability to draw threshold lines HOT 2
- Documentation: clarify how to use multiple independent variables
- Request: a chart title method
- assignColor can't accept a color object HOT 1
- dimple.plot.pie documentation is inconsistent HOT 2
- Fill in plot holes with a solid color for line chart.
- Best strategy for showing very long legends? HOT 2
- Line marker shapes for line chart
- Dimple seems to be broken with D3 v5.
- Not really an issue - more of a feature request/clarification?
- Running examples locally
- Multiple tooltips HOT 1
- Sorting by numeric field strangely causes sort by month
- Markers should be drawn after areas so z-order doesn't make tool tips inaccessible
- Horizontal scrolling in bar chart
- d3 version 7.8.0 support HOT 1
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 dimple.