phibr0 / obsidian-charts

Charts - Obsidian Plugin | Create editable, interactive and animated Charts in Obsidian via Chart.js
https://charts.phib.ro/
GNU Affero General Public License v3.0
546 stars 25 forks source link

Change text/font size #87

Open erikshelley opened 1 year ago

erikshelley commented 1 year ago

Describe the feature

The text elements on the charts are smaller than my default vault font size which makes them difficult for me to read. It would be helpful if the font sizes could be customized. It would also be nice to have different sizes for different types of text (titles, axes labels, legends, etc).

Does this fix a problem? If so, specify.

Chart text readability

image

Did you consider other alternatives?

I reviewed the plugin settings, documentation and code but could not find any way to change the font size.

Screenshots and recordings

No response

Pshemas commented 11 months ago

seconded - ability to set font size would be welcome. Even more so for the "save as image" option. Currently when I turn the chart into PNG text becomes super tiny and some of the labels are missing.

With the option to set the proper font size this for me would take this plugin to another level - I wouldn't have to use almost any external tools when working on paper for my school in Obsidian.

sector101010 commented 6 months ago

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',
                            }
                        }
                    }
                }
XiangFFF commented 2 months ago

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',
                            }
                        }
                    }
                }

I tried this method, but it didn't seem to work, can you provide the whole code block as an example? What is the specific demand for the font family ? Not blank just fine?