lavolp3 / MMM-AVStock

MagicMirror module for displaying stock price with yfinance API
MIT License
39 stars 18 forks source link

How do you adjust the timeframe on the chart? #71

Closed thymon13 closed 6 months ago

thymon13 commented 1 year ago

Hello @lavolp3

Thanks for your work ! I don't understand how to adjust the chart. As you can see below, the chart spans over 1 year, but the data is spread over 1 month. avstock

chartDays: 90,

"What option should I modify? Because I've tried a bit of everything..." ?

thx in advance.

lavolp3 commented 1 year ago

Hi thymon, can you post the complete config please?

thymon13 commented 1 year ago

Hi thymon, can you post the complete config please?

Yes sure 👍

{ //disabled:true, module: "MMM-AVStock", position: "top_right", config: { apiKey : "hidden", coloredCandles : true, symbols : ["^FCHI","BTC-USD"], alias: ["CAC40","BitCoin"], mode : "table", direction: 'column', classes: 'xsmall', showChart: true, showVolume: false, showPurchasePrices: false, showPerformance2Purchase: false, chartType: 'line', coloredCandles: true, chartDays: 90, width: 350, decimals: 2, poolInterval : 5 60 1000, tickerDuration: 5, // Ticker will be cycled once per this second. timeFormat: "DD-MM-YYYY HH:mm:ss", } },

andygodber commented 8 months ago

Hi both - did this get resolved? I couldnt get the date range to change either. I experimented with chartWidth - any value 449 or below seems to make the x-axis have correct labelling, but no content. If its 450 or above, you get the data but x-axis tries to show a 1 year view. (but only c 60 days of content) Also, the chartDays value seems to have no effect.

rmcelwee commented 8 months ago

Hi both - did this get resolved? I couldnt get the date range to change either. I experimented with chartWidth - any value 449 or below seems to make the x-axis have correct labelling, but no content. If its 450 or above, you get the data but x-axis tries to show a 1 year view. (but only c 60 days of content) Also, the chartDays value seems to have no effect.

Just as a data point, I have the same problem as you with my single stock chart. I get a chart area that spans the width of my monitor but the line only takes a small percentage of it. It does move from time to time, I think at the begging of a new month. So, your line is at the far right of the chart and 30 days later it will move to the middle of the chart. I wouldn't mind if I could display two of them side by side (say a 1 year chart and a 1 day chart of the same stock) but I haven't found a way to do that.

lavolp3 commented 6 months ago

can you please check again with the latest update and report back? @rmcelwee

rmcelwee commented 6 months ago

I did the following and the trendline is still "small":

rm -r node_modules

npm install

On Sun, May 12, 2024 at 5:28 PM Dirk @.***> wrote:

can you please check again with the latest update and report back? @rmcelwee https://github.com/rmcelwee

— Reply to this email directly, view it on GitHub https://github.com/lavolp3/MMM-AVStock/issues/71#issuecomment-2106394743, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARYB3IRZ4MXXM2YHH3KW6F3ZB7UJFAVCNFSM6AAAAAA72XO6JOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGM4TINZUGM . You are receiving this because you were mentioned.Message ID: @.***>

lavolp3 commented 6 months ago

The git pull was probably missing. For an update of a module you always need to do a git pull, then best to update the dependencies as well.

rm -r node_modules
rm package-lock.json
git pull
npm install
lavolp3 commented 6 months ago

Hi both - did this get resolved? I couldnt get the date range to change either. I experimented with chartWidth - any value 449 or below seems to make the x-axis have correct labelling, but no content. If its 450 or above, you get the data but x-axis tries to show a 1 year view. (but only c 60 days of content) Also, the chartDays value seems to have no effect.

@andygodber Not sure if it adresses your issue but I fixed an error in the chart yesterday. You're invited to try out as well.

chartDays option should work now again as well.

rmcelwee commented 6 months ago

Yes, that was it. The chart looks much better now. Thanks!

On Mon, May 13, 2024 at 2:10 AM Dirk @.***> wrote:

The git pull was probably missing. For an update of a module you always need to do a git pull, then best to update the dependencies as well.

rm -r node_modules rm package-lock.json git pull npm install

— Reply to this email directly, view it on GitHub https://github.com/lavolp3/MMM-AVStock/issues/71#issuecomment-2106814607, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARYB3IWYMAUGUDLUAGARU2TZCBRQBAVCNFSM6AAAAAA72XO6JOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWHAYTINRQG4 . You are receiving this because you were mentioned.Message ID: @.***>

lavolp3 commented 6 months ago

@andygodber @thymon13 can you let me know if the module works for you now as expected? Thanks!

andygodber commented 6 months ago

@andygodber @thymon13 can you let me know if the module works for you now as expected? Thanks!

Looks good - thanks for fixing

lavolp3 commented 6 months ago

thank you for the feedback. Closing this now.