Comments (6)
There is a way to change the fonts, but it's a bit complicated and cumbersome if you have multiple charts.
It would be great if we could update the defaults of all charts, the same you would when interacting with the Chart.js library directly.
More or less like this:
Chart.defaults.color = "#dcddde";
Chart.defaults.borderColor = "#444";
Chart.defaults.maintainAspectRatio = false;
Chart.defaults.elements.bar.borderWidth = 1;
Chart.defaults.elements.bar.hoverBorderWidth = 2;
Chart.defaults.plugins.title.display = true;
Chart.defaults.plugins.title.font = { weight: "normal", size: 20 };
This would make it so much easier to use charts through Dataview scripts. Perhaps introducing more plugin settings for defaults would be a decent way to accomplish it? Or at least exposing the options programmatically.
from obsidian-charts.
There is a way to change the fonts, but it's a bit complicated and cumbersome if you have multiple charts. It would be great if we could update the defaults of all charts, the same you would when interacting with the Chart.js library directly.
More or less like this:Chart.defaults.color = "#dcddde"; Chart.defaults.borderColor = "#444"; Chart.defaults.maintainAspectRatio = false; Chart.defaults.elements.bar.borderWidth = 1; Chart.defaults.elements.bar.hoverBorderWidth = 2; Chart.defaults.plugins.title.display = true; Chart.defaults.plugins.title.font = { weight: "normal", size: 20 };
This would make it so much easier to use charts through Dataview scripts. Perhaps introducing more plugin settings for defaults would be a decent way to accomplish it? Or at least exposing the options programmatically.
Hi larssont, could you please share where to insert the code to make it work?
Those were simply suggestions on how I would want the configuration to work for obsidian-charts, but it is not possible to configure the fonts in that manner exactly (unless something has changed since last time I looked into this).
from obsidian-charts.
I found you can set the font like this - you need to also set the 'family', otherwise it won't take hold:
scales: {
x: {
ticks: {
font: {
size: 30,
family:'Arial',
}
}
},
y: {
ticks: {
font: {
size: 30,
family: 'Arial',
}
}
}
}
from obsidian-charts.
I found you can set the font like this - you need to also set the 'family', otherwise it won't take hold:
scales: { x: { ticks: { font: { size: 30, family:'Arial', } } }, y: { ticks: { font: { size: 30, family: 'Arial', } } } }
Hi sector101010, could you please share where to insert the code to make it work?
from obsidian-charts.
There is a way to change the fonts, but it's a bit complicated and cumbersome if you have multiple charts. It would be great if we could update the defaults of all charts, the same you would when interacting with the Chart.js library directly.
More or less like this:
Chart.defaults.color = "#dcddde"; Chart.defaults.borderColor = "#444"; Chart.defaults.maintainAspectRatio = false; Chart.defaults.elements.bar.borderWidth = 1; Chart.defaults.elements.bar.hoverBorderWidth = 2; Chart.defaults.plugins.title.display = true; Chart.defaults.plugins.title.font = { weight: "normal", size: 20 };
This would make it so much easier to use charts through Dataview scripts. Perhaps introducing more plugin settings for defaults would be a decent way to accomplish it? Or at least exposing the options programmatically.
Hi larssont, could you please share where to insert the code to make it work?
from obsidian-charts.
I see, thanks for your reply.
from obsidian-charts.
Related Issues (20)
- [Bug]: Time on Y axis
- [Bug]: No theme colors when using window.renderChart HOT 4
- Can't Access Documentation HOT 4
- [Bug]: No color after 6 points HOT 2
- chart.js plugin
- Chandle stick chart
- Add datalabels plugin HOT 2
- New plugin name requirements HOT 2
- Can the function of drawing scatter plots be added? HOT 2
- I've been trying to solve this for 2 days and I can't. The graph is displayed , but no data is shown. I don't know what to do. =( #help HOT 1
- [Bug]: annotations don't work with chart-from-table
- chartjs plugin annotation integration
- charts.js 4.4.1 update -
- Show values right on a pie
- Any chance this could be made to work together with formulas used by Advanced Tables? HOT 4
- add onClick from chart to page representing data
- Ability to insert charts within tables
- [Bug]:Values does not summarise when there are few rows with same label
- [Bug]: bestFit doesn't consider data loaded from table HOT 1
- Secondary Y Axis
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 obsidian-charts.