Naas Documentation
Naas.ai
GitHub
Slack Community
What's new?
Search…
Welcome to Naas
😎
Templates
AWS
Airtable
AlphaVantage
Bazimo
Boursorama
Bubble
CCXT
CSV
Canny
Celestrak
Cityfalcon
D-Tale
Dask
Data.gouv.fr
Draft Kings
EM-DAT
Elasticsearch
Excel
FAO
FEC
FTP
GitHub
Gmail
Google Analytics
Google Drive
Google Search
Google Sheets
HTML
Healthchecks
HubSpot
Hugging Face
IFTTT
IMDB
INPI
IUCN
Insee
Instagram
Integromat
Johns Hopkins
Jupyter
Jupyter Notebooks
LinkedIn
Matplotlib
Metrics Store
Microsoft Teams
Microsoft Word
MongoDB
MySQL
NASA
Naas
Naas Auth
Neo
Newsapi
Notion
OpenWeatherMap
OwnCloud
PDF
Pandas
Pillow
Pipedrive
Plaid
Plotly
Create Heatmap
Create Leaderboard stacked
Create Horizontal Barchart
Create Linechart
Create Leaderboard
Create Waterfall chart
Create Vertical Barchart stacked
Create Gantt chart
Create Bubblechart
Create Vertical Barchart group
Create Candlestick
Create Mapchart world
Create Vertical Barchart
PostgresSQL
PyPI
Python
Qonto
Quandl
Reddit
Redshift
Remoteok
Remotive
SAP-HANA
SendGrid
Slack
Snowflake
Societe.com
Spotify
Streamlit
Stripe
Telegram
Thinkific
TikTok
Trello
Twilio
Twitter
WSR
WorldBank
Worldometer
XML
YahooFinance
YouTube
Youtube
ZIP
Zapier
spaCy
Google Analytics
Google Drive
Google Search
Google Sheets
Hugging Face
Johns Hopkins
Jupyter Notebooks
Metrics Store
Microsoft Teams
Microsoft Word
Naas Auth
Elastic Search
Excel 365
🔄
Low-code features
🏎
Low-code drivers
🌎
Community
Essentials
Advanced
Best Practices
FAQ
⚡
Naas manager
🔐
Security
Powered By
GitBook
Create Linechart
Tags:
#plotly #chart #linechart #trend #dataviz #yahoofinance #naas_drivers #snippet
Author:
Jeremy Ravenel
Learn more on the Plotly doc : https://plotly.com/python/line-charts/
Input
Import libraries
1
import
naas
2
from
naas_drivers
import
yahoofinance
,
plotly
Copied!
Variables
1
title
=
"Linechart"
2
3
# Output paths
4
output_image
=
f"
{
title
}
.png"
5
output_html
=
f"
{
title
}
.html"
Copied!
Get data
1
date_from
=
-
360
# Date can be number or date or today
2
date_to
=
"today"
3
df
=
yahoofinance
.
get
(
"TSLA"
,
4
date_from
=
date_from
,
5
date_to
=
date_to
)
6
df
Copied!
Model
1
fig
=
plotly
.
linechart
(
df
,
2
x
=
"Date"
,
3
y
=
[
"Open"
,
"Close"
],
4
title
=
title
,
5
yaxis_title
=
"Price in quot;
)
Copied!
Output
Export in PNG and HTML
1
fig
.
write_image
(
output_image
,
width
=
1200
)
2
fig
.
write_html
(
output_html
)
Copied!
Generate shareable assets
1
link_image
=
naas
.
asset
.
add
(
output_image
)
2
link_html
=
naas
.
asset
.
add
(
output_html
,
{
"inline"
:
True
})
3
4
#-> Uncomment the line below to remove your assets
5
# naas.asset.delete(output_image)
6
# naas.asset.delete(output_html)
Copied!
Previous
Create Horizontal Barchart
Next
Create Leaderboard
Last modified
2mo ago
Copy link
Edit on GitHub
Contents
Input
Model
Output