Comments (4)
The final parameter is actually a stride in bytes, rather than elements. So if you change 1 to 1 * sizeof(float)
and 2 to 2 * sizeof(float)
, then you will get more reasonable results.
Additionally, the third parameter is actually supposed to be an "offset" for the data points. It turns out that the native code will wrap around if it reaches the end of the data (actually, it will trigger an assertion, but those are disabled in the version of cimgui being used). Since you're using the length of the array, it's just wrapping back around to the beginning.
Aside from that, there is actually a genuine issue with the current wrapper method, because there's no way to specify the number of elements to plot yourself -- the full array size is always used. There should probably be an overload where you can pass in the length yourself, in addition to the "start index" (that's effectively the third parameter in the current version). If you wanted to use a stride of 2-floats, then you'd want to only draw half as many elements, otherwise it'll end up reading values past the end of the array.
@se5a Let me know if that makes sense.
from imgui.net.
size in bytes... ok that.. that would make more sense.
yeah I think I understand the offset, it's just most examples I saw appeared to use the length of the array for some odd reason.
off to try this size in bytes now!
from imgui.net.
@se5a I pushed a commit with a new PlotHistogram
overload:
void PlotHistogram(
string label,
float[] values,
int startIndex,
int count,
string overlayText = null,
float scaleMin = float.MaxValue,
float scaleMax = float.MaxValue,
Vector2 graphSize = default(Vector2),
int elementStride = 1)
This one should be easier to understand, and has default parameter values that match the native API.
from imgui.net.
My histograms are now with 100% less giberish. thanks!
cool, that should help future confused people.
/// xml comments could go a long way to helping make things less confusing too, but I guess that'd be a lot of work to go through and do everything.
from imgui.net.
Related Issues (20)
- Can you provide a nuget package that includes ImGuizmo?
- ImgGui.Button() function is not rendering in my program (.NET 7, ImGui.net ver 1.90.0.1, Veldrid.ImGui ver 5.72.0, ClickableTransparentOverlay ver 9.1.0, SixLabors.ImageSharp ver 3.0.2, Vortice.Mathematics ver 1.7.2) HOT 1
- Breaking Changes For Handling Inputs > v1.90.0.0
- Is there a way to debug unbalanced ImGUI calls? Expecting IM_ASSERT_USER_ERROR but instead get silence HOT 3
- Access Violation With using ImGui.Begin HOT 2
- Unable to change the font for rendering text. HOT 18
- ImGui.PushStyleVar passes incorrect Y value for ImGuiStyleVar.WindowMinSize since version 1.90.0.0 HOT 5
- End of netstandard2.0 support
- ImGuiController problem HOT 1
- Problem merging font awesome into default font HOT 4
- Popups HOT 1
- Bad code gen for SlideInt2(), etc. HOT 2
- imgui.net is missing NuGet package README file
- Scaled fonts are low quality HOT 1
- Gamepad navigation does not work HOT 3
- CustomWidget sliders share the same value HOT 4
- Custom rendering examle HOT 1
- Add ReadOnlySpan<byte> overloads for string parameters HOT 1
- ImGui not showing on my whole screen HOT 1
- file dialog
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 imgui.net.