obsidian-tracker icon indicating copy to clipboard operation
obsidian-tracker copied to clipboard

Changing the size of the chart

Open dummifiedme opened this issue 3 years ago • 12 comments

I tried looking for a way to change the plotted graph area, but couldn't find any way. Can the area or the size of the graph be changed?

Currently it previews as a square block, I intend to have it full page width and maybe scrollable too. Possible?

dummifiedme avatar Jun 30 '21 11:06 dummifiedme

Parameter fixedScale and fitPanelWidth are prepared for you! Please also check the example here.

pyrochlore avatar Jun 30 '21 12:06 pyrochlore

These functions are just scaling the image..not per se extending the width only. I mean, the y-axis should be extendable, right?

dummifiedme avatar Jun 30 '21 12:06 dummifiedme

Hi, do you mean change the aspect ratio of the chart area? Keep the height and increase the width only?

pyrochlore avatar Jun 30 '21 13:06 pyrochlore

I wish to increase the y-axis. Not like stretching the whole "image"

dummifiedme avatar Jun 30 '21 14:06 dummifiedme

If you just want to extend the range of y values on y-axis, use parameter yMin and yMax.

But if you want to change the 'length' of y-axis only, the current code does not allow it.

That should be taken carefully or the entire layout would be messed up.

pyrochlore avatar Jun 30 '21 15:06 pyrochlore

Okay, thanks! :)

dummifiedme avatar Jun 30 '21 15:06 dummifiedme

+1 for this, that would be amazing

martincodez avatar Oct 07 '21 10:10 martincodez

+1, being able to control the relative slope of trend lines is really important. (Anything too far away from 45° becomes unreadable.) For a lengthy treatment of this and a really fancy solution, read https://idl.cs.washington.edu/files/2006-Banking-InfoVis.pdf. Or just look at this first example from the paper:

sample1

Automatic aspect ratio correction would be really cool, but for starters just being able to set that manually would be tremendously valuable. (Right now, I'm extending either x or y axis with bogus space to control the aspect ratio, which wastes a lot of space - usually around 60-75% - and makes one of the axes hard to read.)

229c9cf0 avatar Dec 01 '21 10:12 229c9cf0

+1 for this!

Especially full-width graphs would be great to have

danielbarl avatar Feb 13 '22 18:02 danielbarl

Hey! Just want to +1 full-width graphs. This is becoming crucial for me as my tracker graphs age, and more and more data gets packed into a tiny horizontal space. It's becoming harder over time to derive meaning from the graph. You can see what I mean here. Screen Shot 2022-02-25 at 8 57 32 PM I noticed this feature isn't on the roadmap. Does it seem like something you'll be able to implement at some point? I wish we could pay to support your efforts!

neonplants avatar Feb 26 '22 01:02 neonplants

Since this is getting more an more annoying, I dug into the source a bit... as far as I can tell, for line graphs, all it takes is to change this line (or its equivalent in the generated JS) from the current (300, 300) to e.g. (300, 75), and things Just Work™.

So @neonplants if you're only using line graphs, consider searching in the code in .obsidian/plugins/obsidian-tracker/main.js for dataAreaSize and adjusting it to your desired aspect ratio. (That plus fitPanelWidth: true in the plot YAML should make things quite readable.) Be aware that this will mess up pretty much all other plot types.

And @pyrochlore:

That should be taken carefully or the entire layout would be messed up.

Since – at least for line graphs – this isn't actually true:

image

…it would be really great if that was added as an option in the YAML. (E.g. as aspectRatio with a default of 1.0, and instead of (300, 300), you'd use (300, 300/aspectRatio), with aspectRatio defaulting to 1 for all graphs where it doesn't make sense to change it.)

229c9cf0 avatar Feb 26 '22 09:02 229c9cf0

Thanks @229c9cf0 ! It's rough because I do use the other graph types extensively. @pyrochlore what do you think?

neonplants avatar Mar 05 '22 00:03 neonplants

Is there any update on this?

This is such a feature rich plugin. Which is why I was all the more surprised that there was no way to change the aspect ratio from the current 1:1 to something more suitable for line graphs like 4:1 or similar. Especially since the fix seems so easy as outlined above.

Adding this feature would be highly appreciated 🙂

+1 <3

andrew-wiskus avatar Nov 08 '22 23:11 andrew-wiskus

+1 for sure!

steebus avatar Nov 28 '22 23:11 steebus

+1 for sure!

AndyJZhao avatar Dec 06 '22 02:12 AndyJZhao

Hi, to complete @229c9cf0 's suggestion : it seems to work perfectly using "600, 300" instead. The axes and ticks keep their original sizes.

cesarfue avatar Dec 21 '22 19:12 cesarfue

+1

CoderRuq avatar Jan 07 '23 02:01 CoderRuq

+1 from me

pictoys avatar Aug 29 '23 07:08 pictoys

+1 from me

zhangyiy0223 avatar Sep 07 '23 02:09 zhangyiy0223

+1 from me - 1:1 makes allot of charts unreadable

alayhi avatar Oct 09 '23 12:10 alayhi

+1 from me

xiaopin129 avatar Nov 07 '23 06:11 xiaopin129

1.12.0 (just released) adds an aspectRatio parameter that should solve for this issue. See #239

lazyguru avatar Nov 08 '23 03:11 lazyguru