Comments (6)
Hiya, please take a look in 0.13.0 including an updating function for filled bars.
from circuitpython_uplot.
It appears to be running out of colors as the color sequence is always the same. Is there a way to have the bar graph color array loop so it doesn't run out? There seems to be 11 colors in the index and once it refreshes 3 times it runs out of colors in the index. I'm pulling 5 colors per refresh and on the 3rd refresh it only displays 1 bar because it runs out of colors. So it's not an a or b index issue it's a color index issue.
from circuitpython_uplot.
Thank you, yes, that was the case. Please see https://github.com/jposada202020/CircuitPython_uplot/releases/tag/0.11.2
just FYI according to my test you will run out of memory in the 49 refresh at least with 5 bars. The library could be modified to have a function to update the bars with a specific function a preserve memory, and run ideally forever, but will require more development. If you are happy to wait, I am happy to code it :)
from circuitpython_uplot.
Definitely better. Been running it for about an hour every 30 seconds and haven't hit the limit yet. If you say it should get about 50 attempts before running out of ram then that's 50x30= 25 minutes. I've been running it for well over an hour. I'm using an unexpected maker S3 which has 8MB of psram, it might take a little longer.
I have noticed some odd artifacts though starting on the 3rd refresh with the first two bars either skipped or black.
ubar(plot, a, b, 0xFF1000, True)
Then the next get request after that one I get this.
The cycle repeats itself infinitely so far every 3rd or 4th refresh after that with the black bars and red overdraw. The tops of the graphs aren't displaying correctly to correlate with the values. Quite an odd effect.
Things seem to still overdraw instead of removing/replacing the graph. I have no idea how it works just showing you the results.
from circuitpython_uplot.
After about 2 hours becomes unrecognizable and not very useful to say the least. There's definitely some room for improvement.
from circuitpython_uplot.
Indeed, you are creating new barplot instances one on top of the other so this is expected, the library auto-scale the limits so sometimes previous bar are hidden and sometimes they are not. This will be the normal behaviour unless a new update function is created in the library to update the original bars. A hack, is to remove the bar from the group as in the following example:
# SPDX-FileCopyrightText: Copyright (c) 2023 Jose D. Montoya, DJDevon
#
# SPDX-License-Identifier: MIT
import board
from circuitpython_uplot.uplot import Uplot, color
from circuitpython_uplot.ubar import ubar
import time
# Setting up the display
display = board.DISPLAY
# Configuring display dimensions
DISPLAY_WIDTH = 480
DISPLAY_HEIGHT = 320
# Defining the plot
plot = Uplot(
0,
0,
DISPLAY_WIDTH,
DISPLAY_HEIGHT,
background_color=color.BLACK,
padding=10,
box_color=color.BLACK,
)
# Dummy data to plot
activities_latest_heart_value = [55, 20, 25, 30, 35, 10]
a = ["a", "b", "c", "d", "e", "f"]
number_of_bars = len(activities_latest_heart_value)
multiplier = 1
# Showing the plot
display.show(plot)
for i in range(20):
activities_latest_heart_value_changed = [
j + multiplier for j in activities_latest_heart_value
]
ubar(
plot,
a,
activities_latest_heart_value_changed,
0xFF1000,
True,
color_palette=[
0xFF1000,
0x00FF00,
0x0000FF,
0xFFFF00,
0x00FFFF,
0x123456,
],
)
multiplier += 1
time.sleep(1)
for _ in range(number_of_bars):
plot.pop()
from circuitpython_uplot.
Related Issues (15)
- ISSUE: box color needs to be custom HOT 3
- Need better scale description HOT 3
- Setting the max_value to larger than screen size blows up with height must be above 1. HOT 3
- Setting uplot padding to 0 doesnt behave as expected HOT 2
- Bar3d Returns None HOT 1
- Bar Plot Scale space between bars not working HOT 1
- Add a tickheight for x and tickheight for y HOT 3
- ISSUE: rangey issues HOT 8
- ISSUE: first pixel is never shown HOT 1
- ISSUE: first pixel is never shown HOT 2
- Please add number of tickx and ticky HOT 11
- Please implement Thickness HOT 4
- Release zip file without the compiled python files HOT 4
- IDEA: fill with a mesh on white and black EInk displays HOT 7
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 circuitpython_uplot.