So I am trying to set paddings on the chart, so that the data series do not touch chart edges
I can’t do it with View’s method setPadding because then the black background is present (screenshot shows padding on all sides but I need just left and right)
Also, I managed to achieve no labels, axes, grids etc. but in totally hacky way; I set .withIsCenterAxis and then all other things to false
.withAxisId(Y_AXIS_ID)
.withDrawMajorBands(false)
.withDrawMajorGridLines(false)
.withDrawMinorGridLines(false)
.withDrawLabels(false)
.withIsCenterAxis(true)
.withDrawMajorTicks(false)
.withDrawMinorTicks(false)
Is there a normal way of doing this?
thanks
- Laszlo Bonkers asked 5 years ago
- last active 5 years ago
Good morning,
I would like to ask you about the solution contained in the title. Is it possible to create realtime charts (for example 7-10) in a list (RecyclerView)? I have studied your example but there were none with a list.
The fragment in the example called createMultiPaneStockChartsFragment contains 4 charts. But unfortunately, it is not a list.
I made a simple activity with 5 charts in a RecyclerView, but charts are stucking a bit.
I do not call notify methods. There is only update LineData method:
oneChartClass.getLineData().append(oneChartClass.getLineData().getCount(), trendPoint.getValue());
Thanking you in advance…
Hubert
- Hubert Lączak asked 5 years ago
- last active 2 years ago
Hi all,
Why the API’s for iOS, Android and WPF are not identically?
I have seen many samples on the forum, but to adapt it to a different platform is very hard.
A lot of classes are different for each platform.
- Is there any “comparison” for the different platforms?
- Is this planned to unify the API’s?
Regards
Urs
- Urs Geser asked 5 years ago
- last active 5 years ago
Hi
I have a line chart that has already been drawn and synced with a sound.
when we play sound, chart begin to scroll horizontally.
but problem is lagging when scrolling chart.
Is there a way to fix this problem?
private Runnable mRunnable = new Runnable() {
@Override
public void run() {
forceRunInPauseMode = false;
getActivity().runOnUiThread(() -> {
currentTime = (int) exoPlayer.getCurrentPosition();
binding.tvCurrentDuration.setText(MiliToTimeConverter.milliToTime(currentTime));
});
int currentRange = currentTime * 2;
if (!isDraw) {
DoubleValues xValues = new DoubleValues(Arrays.copyOfRange(xDoubleArray, 0, xDoubleArray.length - 1));
DoubleValues yValues = new DoubleValues(Arrays.copyOfRange(yDoubleArray, 0, yDoubleArray.length - 1));
DoubleSeries doubleSeries = new DoubleSeries(xValues, yValues);
lineData.append(doubleSeries.getxValues(), doubleSeries.getyValues());
isDraw = true;
}
xVisibleRange.setMinMax(currentRange - visibleInterval / 2, currentRange + visibleInterval / 2);
}
};
private void updateChart() {
schedule = scheduledExecutorService.scheduleWithFixedDelay(() -> {
if (!isPlaying && !forceRunInPauseMode)
return;
UpdateSuspender.using(binding.sciChart, mRunnable);
}, 0, TIME_INTERVAL, TimeUnit.MILLISECONDS);
}
private void pause() {
exoPlayer.setPlayWhenReady(false);
binding.ivPlay.setImageResource(R.drawable.ic_play);
if (schedule != null)
schedule.cancel(false);
}
private void initSciChart() {
isChartConfigured = true;
SciChartBuilder.init(getContext());
binding.sciChart.setBackgroundColor(getResources().getColor(R.color.colorTransparent));
// Obtain the SciChartBuilder instance
SciChartBuilder mSciChartBuilder = SciChartBuilder.instance();
//set border style
binding.sciChart.setRenderableSeriesAreaBorderStyle(null);
xVisibleRange = new DoubleRange();
// Create a numeric X axis
final IAxis xAxis = mSciChartBuilder.newNumericAxis()
.withVisibleRange(xVisibleRange)
.withGrowBy(new DoubleRange(0.25d * visibleInterval / totalDuration, 0.25d * visibleInterval / totalDuration))
.withAutoRangeMode(AutoRange.Never)
.build();
final IAxis yAxis = mSciChartBuilder.newNumericAxis()
.withVisibleRange(-1d, 1d)
.withAutoRangeMode(AutoRange.Never)
.build();
xAxis.setVisibleRangeChangeListener((iAxisCore, oldRange, newRange, isAnimating) -> {
if (!isPlaying) {
double c = ((newRange.getMinAsDouble() + newRange.getMaxAsDouble()) / 4);
getActivity().runOnUiThread(() -> binding.tvCurrentDuration.setText(MiliToTimeConverter.milliToTime((long) c)));
}
});
xAxis.setDrawMajorGridLines(false);
xAxis.setDrawMinorGridLines(false);
xAxis.setDrawMajorBands(false);
xAxis.setDrawMajorTicks(true);
xAxis.setDrawMinorTicks(true);
xAxis.setTickProvider(new CustomTickProvider());
xAxis.setMaxAutoTicks(MAX_AUTO_TICKS);
xAxis.setMinorsPerMajor(MINOR_PER_MAJOR);
xAxis.setVisibility(View.GONE);
yAxis.setDrawMajorGridLines(false);
yAxis.setDrawMinorGridLines(false);
yAxis.setDrawMajorBands(false);
yAxis.setDrawMajorTicks(false);
yAxis.setDrawMinorTicks(false);
yAxis.setTickProvider(new CustomTickProvider());
yAxis.setMaxAutoTicks(MAX_AUTO_TICKS);
yAxis.setMinorsPerMajor(MINOR_PER_MAJOR);
yAxis.setVisibility(View.GONE);
VerticalLineAnnotation verticalLine = mSciChartBuilder.newVerticalLineAnnotation()
.withX1(0.5) // black
.withStroke(new SolidPenStyle(ColorUtil.argb(250, 120, 126, 136), true, 1f, null))
.withCoordinateMode(AnnotationCoordinateMode.RelativeX)
.build();
ModifierGroup chartModifiers = mSciChartBuilder.newModifierGroup()
.withModifier(new GestureModifierBase() {
@Override
public void detach() {
super.detach();
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
return false;
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
// Scroll X
xAxis.scroll((-distanceX/2), ClipMode.ClipAtExtents);
return true;
}
})
.build();
lineData = mSciChartBuilder.newXyDataSeries(Double.class, Double.class).build();
XyDataSeries staticData = mSciChartBuilder.newXyDataSeries(Double.class, Double.class).build();
final FastLineRenderableSeries lineSeries = mSciChartBuilder.newLineSeries()
.withDataSeries(lineData)
//.withPointMarker(mSciChartBuilder.newPointMarker(new EllipsePointMarker()).withSize(7, 7).withStroke(0xFF006400, 1).withFill(0xFFFFFFFF).build())
.withPaletteProvider(new XYCustomPaletteProvider(ColorUtil.argb(255, 50, 153, 0))) // green
.withStrokeStyle(ColorUtil.argb(250, 120, 126, 136), 1f, true) // black
.build();
final IRenderableSeries staticLineSeries = mSciChartBuilder.newLineSeries()
.withDataSeries(staticData)
.withPaletteProvider(new XYCustomPaletteProvider(ColorUtil.argb(255, 50, 153, 0))) // green
.withStrokeStyle(ColorUtil.argb(250, 120, 126, 136), 1f, true) // black
.build();
DoubleValues xValues = new DoubleValues(Arrays.copyOfRange(xDoubleArray, 0, totalRange));
DoubleValues yValues = new DoubleValues(Arrays.copyOfRange(yDoubleArray, 0, totalRange));
DoubleSeries doubleSeries = new DoubleSeries(xValues, yValues);
binding.sciChart.getRenderableSeries().add(lineSeries);
binding.sciChart.getRenderableSeries().add(staticLineSeries);
binding.sciChart.setRenderSurface(new RenderSurface(getContext()));
Collections.addAll(binding.sciChart.getYAxes(), yAxis);
Collections.addAll(binding.sciChart.getXAxes(), xAxis);
Collections.addAll(binding.sciChart.getChartModifiers(), chartModifiers);
Collections.addAll(binding.sciChart.getAnnotations(), verticalLine);
staticData.append(doubleSeries.getxValues(), doubleSeries.getyValues());
lineData.setAcceptsUnsortedData(true);
begin();
}
- abolfazl ghanbari asked 4 years ago
- last active 4 years ago
issue resolved….it happened due to late initialization of super class instance for context.
- Praween Kumar asked 5 years ago
- last active 5 years ago
Hi, I want to draw a chart like the attached image.
This is a chart with XyDataSeries, it show as vertical line at each data point and verticle line is a dotted line in order to separated from other series.
Since the OHLC chart will have the open, close on the data point and an impulse chart is forced to draw from an axis, is there any better way that can achieve a series like this? Thank you!
- may lym asked 4 years ago
- last active 4 years ago
Hello
I have this chart with CategoryXAxis` as X and **NumericAxis as Y. I update its IohlcDataseries with new prices for creating a live chart. I also added a HorizontalLineAnnotation on Y-Axis to point to the current price. The problem is when chart auto-scales on Y-axis it only tries to cover price data and not the Line annotation, and its label is half visible.
- niazi curiosity.mobile2 asked 4 years ago
- last active 4 years ago
Hi
I have a ECG chart with a certain capacity.
I want to apply the fading animation to the part of the chart that is being cleared.
- abolfazl ghanbari asked 4 years ago
- last active 4 years ago
i follow this way to update an exist candle
stockPrices.update(stockPrices.getCount() – 1, priceBar.getOpen(), priceBar.getHigh(), priceBar.getLow(), priceBar.getClose());
it work well but not so smooth, SciChart have any other way or trick to do this ?
Thank you
- tran hai asked 4 years ago
- last active 4 years ago
Hi,
I have multiple custom chart modifiers (PinchZoom, Rollover, SeriesSelection and ZoomPan) and I was wondering if there is a set order in which they handle the touch event or is it random? If there is a set order then can I change this order?
For example now it seems like the rollover modifier handles the touch event before the seriesSelection modifier. This is a bit problematic since the rollover has sourceMode = SourceMode.SelectedSeries
and since the touch event goes first to the rollover it updates its position –> then the new series is selected –> but rollover position does not update since it has already handled the touch event.
- Erika Sankari asked 4 years ago
- last active 4 years ago
I have a line chart and need to implement textAlign: left property for tickLabel on yAxis. I have found some way to do it on the forum, but it does not work in my case:
xAxis.setAxisTickLabelStyle(new AxisTickLabelStyle(Gravity.CENTER, Layout.Alignment.ALIGN_CENTER, 5, 0, 5, 0));
I get the error:
Alignment cannot be converted to int
But according documentation https://www.scichart.com/documentation/android/current/SciChart.Charting~com.scichart.charting.visuals.axes.AxisTickLabelStyle~_ctor.html AxisTickLabelStyle class get 5 int arguments. Can you help me please how to solve it!
- Alexander Kishchak asked 3 years ago
- last active 3 years ago
Hello,
At right chart we have show only one X-axis which needs to update in real time .whenever new values will come we have to update in X-axis in itself instead of adding new line at X-Axis.
Each time New Y – axis will come that will append at left chart (Can be consider left chart showing history of right chart)
Let me know if anything further requred
Thanks.
- vasim simform asked 3 years ago
- last active 3 years ago
Hello Friends,
I'm looking a solution where i can change Y-Axis range in between (0.1,0.2,0.4,0.6,0.8,1.0) .
I appreciate any help for above question
Thanks
Vasim
- vasim simform asked 3 years ago
- last active 3 years ago
i have been working on line charts and i need to show date as well as time on the axis( 21 june 08 05:30:PM like this).I’ve tried with date axis and numeric axis ,but it doesn’t helps.Do we have any suggestions or samples which could help me
- Vinu Gilbert asked 3 years ago
- last active 3 years ago
I am trying to use SciChart library for my project and find out whether it satisfy all requirements.
I am currently trying to display the ECG signal. Therefore the data is coming in realtime.
I have the following configuration
final NumericAxis xAxis = mSciChartBuilder
.newNumericAxis()
.withAxisTitle("Time (seconds)")
.withDrawLabels(false)
.withDrawMajorTicks(false)
.withDrawMinorTicks(false)
.withDrawMajorBands(false)
.withDrawMajorGridLines(false)
.withDrawMinorGridLines(false)
// .withVisibleRange(0, 2040)
.withAutoRangeMode(AutoRange.Always)
//.withAutoRangeMode(AutoRange.Never)
.build();
final NumericAxis yAxis = mSciChartBuilder
.newNumericAxis()
.withAxisTitle("Voltage (mV)")
// .withGrowBy(0.1d, 0.1d)
.withDrawLabels(false)
.withDrawMajorTicks(false)
.withDrawMinorTicks(false)
.withDrawMajorBands(false)
.withDrawMajorGridLines(false)
.withDrawMinorGridLines(false)
.withVisibleRange(Short.MIN_VALUE, Short.MAX_VALUE)
.build();
It works but the X axis a little bit scaled/compress.
Here is the result
enter image description here
I need to make it a bit wider.
How can I do this ?
I have tried to set range manually like that
.withVisibleRange(0, 2040)
However in this case it doesn’t show anything.
I would be grateful for any help.
UPDATE
https://drive.google.com/file/d/17p1E-Z_YxiVh_JtwEvlM1PaTVyJ7eyz7/view
- Durian Odour asked 6 years ago
- last active 6 years ago
How to scale axes with different scale factor using pinch zoom?
For example, scale x axis only or scale x axis greater then y axis.
- Dmitry Kozhin asked 7 years ago
- last active 3 months ago
Hi, i want to make something like that : https://i.ibb.co/617TmD2/screenshot-line.png
I have tried HorizontalLineAnnotation but i successed to have it only on bottom graph : https://i.ibb.co/qsCjjGd/screen-bot-graph.png
Here how i initialize my top graph :
@Override
public void initGraph(Context context) {
Log.d(TAG, "initGraphs");
SciChartSurface spectogramSciChart = new SciChartSurface(context);
spectogram.addView(spectogramSciChart);
xAxis = new NumericAxis(context);
xAxis.setAutoRange(AutoRange.Always);
xAxis.setDrawMinorTicks(false);
xAxis.setDrawMajorBands(false);
xAxis.setDrawMinorGridLines(false);
xAxis.setAxisAlignment(AxisAlignment.Left);
xAxis.setFlipCoordinates(true);
xAxis.setAxisTitle("Frequences (KHz)");
xAxis.setAxisTitleOrientation(AxisTitleOrientation.VerticalFlipped);
spectogramSciChart.getXAxes().add(xAxis);
yAxis = new NumericAxis(context);
yAxis.setVisibleRange(new DoubleRange(startSpectrogramRange, endSpectrogramRange));
yAxis.setDrawLabels(false);
yAxis.setDrawMinorTicks(false);
yAxis.setDrawMajorBands(false);
yAxis.setDrawMinorGridLines(false);
yAxis.setAxisAlignment(AxisAlignment.Bottom);
yAxis.setFlipCoordinates(true);
yAxis.setAxisTitleOrientation(AxisTitleOrientation.Horizontal);
spectogramSciChart.getYAxes().add(yAxis);
FastUniformHeatmapRenderableSeries f = new FastUniformHeatmapRenderableSeries();
scichartTools.getSpectrogramDS().setStartX(0f);
scichartTools.getSpectrogramDS().setStepX(0.9f);
f.setDataSeries(scichartTools.getSpectrogramDS());
f.setMaximum(100);
f.setMinimum(-30.0);
f.setColorMap(new ColorMap(
new int[]{ColorUtil.Transparent, ColorUtil.DarkBlue, ColorUtil.Purple, ColorUtil.Red, ColorUtil.Yellow, ColorUtil.White},
new float[]{0f, 0.0001f, 0.25f, 0.50f, 0.75f, 1f}
));
spectogramSciChart.getRenderableSeries().add(f);
scichartTools.getSpectrogramValues().setSize(scichartTools.getFftSize() * scichartTools.getBatchSize() * 2);
// I add the line but it's not displayed
HorizontalLineAnnotation horizontalLine = new HorizontalLineAnnotation(context);
horizontalLine.setHorizontalGravity(Gravity.FILL_HORIZONTAL);
horizontalLine.setY1(5f);
horizontalLine.setLabelValue("Label");
spectogramSciChart.getAnnotations().add(horizontalLine);
}
You can see at the bottom of the function that i added it, but it doesn’t work on this graph. Why ? Maybe the graph is drawing over my line ?
Thanks,
Best regards
- damien gaillard asked 5 years ago
- last active 5 years ago
This issue repros on Android 4.4 API 19, but not API 27. It happens with the example project (Multi-Pane Stock Charts). The issue is that on certain zoom levels, the x-axis labels are cut off (so instead of displaying 11 Mar, it just displays 11).
I have tried to override TradeChartAxisLabelFormatter with my custom implementation but saw the same issue, so the bug seems to be in the provider or somewhere else.
Please see screenshot: https://imgur.com/a/2RDC2MZ
- Mike Liu asked 6 years ago
- last active 6 years ago
How to create the order book depth chart with SciChart?
- Nizzle Bizzle asked 5 years ago
- last active 5 years ago
Hi,
I would like to display all the hours of the day in X axis e.g 01 to 24 and I haven’t been able to achieve it yet, I tried use date delta but I couldn’t figure out how it really works, could you please share a code snippet or some example.
Thanks
- Anas Iqbal asked 2 years ago
- last active 2 years ago
Is it possible?
Or make box annotations fit screen height?
(even when zooming)
- Vadim Kirey asked 5 years ago
- last active 5 years ago
Hi
I want to access the SciTrader application source so that I can implement the features I need by checking it.
Please guide me to access this source code
- Vahid Garousi asked 1 year ago
- last active 1 year ago
I’m trying to implement sciChart to flutter app (Android). It gets pretty confusing when trying to make it work. Anyone have examples how to make SciChart to work on Flutter? Adding the license works just fine. Only need for ECG chart for now. Thanks.
- Valeri Haataja asked 3 years ago
- last active 5 months ago
Hi,
I have a list of 12 items, but at the start I only want to see the last 6 items on the chart (stacked column chart). I want to be able to scroll / drag to reveal the first part of the list. I use the index of the list for the x-axis, so the list has indexes with range from [0, 11]
I’m having some weird behaviour implementing this.
When the data is loaded, i see the complete bars:
but when I start to scroll, i’m never able to reveal the complete bars anymore:
![Screenshot 2020-09-18 at 11.04.40.png][2]
![Screenshot 2020-09-18 at 11.04.59.png][3]
When i start scrolling to the end (although the chart is already at the end), the UI jumps and only shows half a bar. Also when i scroll to the beginning, it only shows half a bar.
How can I make sure I always see the complete bars?
This is the code, specific to the x axis & the scrolling:
val xAxis = sciChartBuilder.newNumericAxis()
.withDrawMajorBands(false)
.withDrawMajorGridLines(false)
.withDrawMinorGridLines(false)
.withDrawMinorTicks(false)
.withMajorDelta(1.0)
.withMinorDelta(0.2)
.withAutoTicks(false)
.withVisibleRange(5.5, 11.5)
.build()
using half values for the range seems to be the only way I can see the full bars. Once I start scrolling I only see half bars at the start & end
val surfaceChartModifiers: ChartModifierCollection = chart.chartModifiers
val dragModifier = XAxisDragModifier()
dragModifier.dragMode = AxisDragModifierBase.AxisDragMode.Pan
surfaceChartModifiers.add(dragModifier)
val zoomPanModifier = ZoomPanModifier()
zoomPanModifier.clipModeX = ClipMode.ClipAtExtents
zoomPanModifier.direction = Direction2D.XDirection
zoomPanModifier.zoomExtentsY = false
surfaceChartModifiers.add(zoomPanModifier)
- Wesley Huyghe asked 4 years ago
- last active 4 years ago
I set a rolloverModifier to a CandlestickSeries, but I can not find a API to hide RolloverMarker,I only find a article about WPF(https://www.scichart.com/documentation/v5.x/webframe.html#RolloverModifier.html), how could I hide RolloverMarker or change the style of RolloverMarker in Android?
- jiahao li asked 4 years ago
- last active 4 years ago
Hi again,
Is it possible to move the rollover modifier without a touch when I know the x-axis and y-axis values?
At the moment user can tap the chart and the rollover modifier shows up and snaps to the closest point. Then I leave the rollover modifier visible by ignoring the onTouchUp() event. I have an external component that has the same data as the graph and now if user selects an item from that external component I would like to move the rollover modifier to that point. How can I do this?
- Erika Sankari asked 4 years ago
- last active 4 years ago
Hello
I was wondering if it would be possible to create a simple clean looking chart like described in the attached image. I am looking for a “SuccessRateChart” that has some similarity to the PieChart but does not use the whole circle to describe its content. I would also need a way to adjust the visible radius of the Pie. In means of information visualization you often hear the term “doughnut chart”…
On way could be to draw some circle stacked over the chart itself, but there should be a better solution.
Would love to hear from you,
Kind regards,
Stephan
- Stephan Raible asked 4 years ago
- last active 4 years ago
Hi
Is there a way to just change the values of the pie segments so it get updated on the donut chart.
If I remove and add the pie segments again it works, is this the correct way?
Also I can’t find any documentation around the donut for android/xamarin
regards
Per
- robin grönlund asked 6 years ago
- last active 6 years ago
I have two questions on rollover modifier.
One is the tooltip of the rollover is right under the finger on a heatmap chart. Can I move it to the top left section of the touch point?
Second question is how can I implement a callback function whenever Y axis of the rollover modifier changes?
Thanks for your attention in advance.
- Gang Xu asked 4 years ago
- last active 4 years ago
I was wondering about the possibilities to show markers. I dug a while in the examples and played with default interactions, which use dragging to update the position of the marker.
On mobile devices this conflicts a little with the pan interaction to move the chart. I saw there’s also the possibility to pan using the axes area. There’s also the possibility to just tap on the chart, which doesn’t conflict with other interactions, to show a marker, but I couldn’t find how to do this. At least there doesn’t seem to be built in support for it? How should this be done?
Additionally I would like once a marker appears to either be able to update only by tapping again at other place on the chart (simple solution) or temporarily disabling the panning such that this gesture only moves the marker and not the chart (preferred, but probably less simple solution). So tapping on the chart would enter “marker mode” which disables zooming and panning and some other gesture – e.g. using an external button on the chart, would leave “marker mode” and enter zoom/pan mode again.
Any ideas how to achieve this? Thanks in advance!
P.S. I’m also using a real time chart, though this probably doesn’t make a difference concerning this.
- Ivan Schütz asked 7 years ago
- last active 7 years ago
Hi,
I’m working on the iOS and android version. I’m trying to implemented an animated visible range change on Y axis when zooming/panning X axis.
On iOS, I just have to do:
yAxis.autoRange = .always
yAxis.animateVisibleRangeChanges = true
yAxis.animatedChangeDuration = 0.5
But I can’t find a way to do that on Android, is it hidden somewhere else?
Kind Regards,
Alexis
- Alexis Durand asked 6 years ago
- last active 6 years ago
Hi,
I set up my xAxis (DateAxis) with a minimalZoomConstrain = DateInterval.fromMinutes(3.0). And here is my PinchZoomModifier:
val pinchZoomModifier = PinchZoomModifier().apply {
direction = Direction2D.XDirection
receiveHandledEvents = true
}
The chart works great and restricts the zoom to three minutes, but I get this error to the console whenever I zoom in to reach the minimalZoomConstrain:
E/Axis: VisibleRange was restored to its last valid value. The range class com.scichart.data.model.DateRange (Min = Tue Jan 09 01:52:40 GMT+01:00 2020, Max = Tue Jan 09 01:55:40 GMT+01:00 2020) either is not valid or it doesn't satisfy MinimalZoomConstrain or MaximumZoomConstrain. To provide fallback value please override AxisCore#coerceVisibleRange(IRange) method
How can I get rid of this error? Is there a way to tell the PinchZoomModifier that there is a min limit?
- Erika Sankari asked 4 years ago
- last active 4 years ago
Hello
Currently trying this:
final NumericAxis yAxis = sciChartBuilder.newNumericAxis()
.withAutoRangeMode(AutoRange.Never)
.withTextFormatting("#.0000")
.withVisibleRangeLimit(1.143, 1.146)
.build();
Works perfectly with values .withVisibleRangeLimit(1.14, 1.15), but every time i go for more precision – range is default 0-10
Please help
Edit:
Also works fine with
.withVisibleRangeLimit(1.1433, 1.1566)
Question 2.
Is there a way to determine that live chart was scrolled by finger or by animation (when adding new point)?
- Kirey Vadim asked 5 years ago
- last active 5 years ago
Is it possible to put a background image on a chart? I hope you can give me a hint thanks in advance.
I attach an image for the purpose of my query.
- Julio Olivos asked 7 years ago
- last active 7 years ago
I’m evaluating chart libraries to my next project and I’m trying to do a simple chart like the one in the attached image.
It was actually very easy to do it using MPAndroidChart, however it’s been hard to do a simple task like put a label aligned with the column… I did take a look into the SciChart sample application, but the application just uses numeric labels…
Can someone provide some guidance of how to do this?
- Nelson Glauber asked 3 years ago
- last active 3 years ago
Hello!
We are using SciChart in our Android application, and our Crashlytics reports that it crashes:
Fatal Exception: java.lang.OutOfMemoryError
Failed to allocate a 4581372 byte allocation with 8664 free bytes and 8KB until OOM
dalvik.system.VMRuntime.newNonMovableArray (VMRuntime.java)
android.graphics.Bitmap.createBitmap (Bitmap.java:727)
com.scichart.drawing.utility.BitmapUtil.createFrom (SourceFile:46)
com.scichart.drawing.opengl.aa. (SourceFile:113)
com.scichart.drawing.opengl.n.createTexture (SourceFile:130)
com.scichart.drawing.common.AssetManagerBase.createTexture (SourceFile:158)
com.scichart.charting.visuals.rendering.a.a (SourceFile:84)
com.scichart.charting.visuals.rendering.a.a (SourceFile:54)
com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.b (SourceFile:364)
com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.a (SourceFile:357)
com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.a (SourceFile:134)
com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDraw (SourceFile:123)
com.scichart.drawing.opengl.RenderSurfaceGL$a.onDraw (SourceFile:228)
com.scichart.drawing.opengl.MyGLRenderer.b (SourceFile:293)
com.scichart.drawing.opengl.MyGLRenderer.onDrawFrame (SourceFile:277)
android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1548)
android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1259)
Can anyone help please?
- Andrii Vovk asked 6 years ago
- last active 6 years ago
I’m seeing the following exception:
E/Exception: null
java.lang.ArrayIndexOutOfBoundsException: length=0; index=-1
at com.scichart.core.model.DoubleValues.get(SourceFile:167)
at com.scichart.charting.numerics.tickProviders.LogarithmicNumericTickProvider.updateTicks(SourceFile:94)
at com.scichart.charting.numerics.tickProviders.TickProvider.update(SourceFile:59)
at com.scichart.charting.numerics.tickProviders.DeltaTickProvider.update(SourceFile:81)
at com.scichart.charting.visuals.axes.AxisBase.onUpdateMeasure(SourceFile:957)
at com.scichart.charting.visuals.axes.AxisBase.updateAxisMeasurements(SourceFile:936)
at com.scichart.charting.layoutManagers.RightAlignmentOuterAxisLayoutStrategy.measureAxes(SourceFile:39)
at com.scichart.charting.layoutManagers.DefaultLayoutManager.onLayoutChart(SourceFile:235)
at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.a(SourceFile:207)
at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.a(SourceFile:132)
at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDraw(SourceFile:123)
at com.scichart.drawing.opengl.RenderSurfaceGL$a.onDraw(SourceFile:234)
at com.scichart.drawing.opengl.MyGLRenderer.b(SourceFile:299)
at com.scichart.drawing.opengl.MyGLRenderer.onDrawFrame(SourceFile:283)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
I’m initializing my chart as follows:
SciChartBuilder.init(context)
builder = SciChartBuilder.instance()
...
val xAxis = builder.newCategoryDateAxis()
.withGrowBy(0.0, 0.05)
.withAxisAlignment(AxisAlignment.Bottom)
.withVisibleRange(sharedXRange)
.withDrawMinorGridLines(true)
.withDrawMajorGridLines(true)
.build()
val yAxis = builder.newLogarithmicNumericAxis()
.withTextFormatting("#.#E+0")
.withScientificNotation(ScientificNotation.LogarithmicBase)
.withLogarithmicBase(2.0)
.build()
val seriesData = builder.newXyDataSeries(Date::class.java, Double::class.javaObjectType)
.withSeriesName("Series A")
.build()
seriesData.append(data.dateData, data.yData)
series = builder.newLineSeries()
.withDataSeries(seriesData)
.build()
UpdateSuspender.using(surface) {
Collections.addAll(surface.xAxes, xAxis)
Collections.addAll(surface.yAxes, yAxis)
Collections.addAll(surface.renderableSeries, series)
}
data object has about 300 valid data points.
Any ideas what’s going on? I tried running this on a new activity. If I swap LogarithmicNumericAxis for a NumericAxis, everything works fine. I looked at the decompiled .class file where the crash was occurring (I don’t have the source for SciChart), and it seems like the crash occurs when major ticks fail to get generated (majorTicks.size == 0). I tried disabling all minor/major ticks but no joy.
for(int var22 = majorTicks.size(); var22 >= 0; --var22) {
double var23 = var4.fromExponent(var11);
double var25 = var22 < majorTicks.size() ? majorTicks.get(var22) : majorTicks.get(var22 - 1) * var23;
- Mike Liu asked 6 years ago
- last active 6 years ago
I hope you can help me, please. Is it possible to remove the lines that protrude on the edge of the graphics, as shown in the image? If so, what would be the procedure?
Thank you very much in advance…
- Julio Olivos asked 7 years ago
- last active 7 years ago
Hi
Sometimes when I call annotation.setIsHidden in a surface with RenderSurfaceGl, not works.
what should I do?
- abolfazl ghanbari asked 3 years ago
We are using single SurfaceMeshRenderableSeries3D chart and added multidata on condition click event but issue is sometime data is loaded or sometime not. So my question is how to refresh 3D chart after added new data ?
- vaibhav patel asked 2 years ago
- last active 2 years ago
Hi,
I’m evaluating SciChart for use in a production app.
Is there any way to log exceptions generated by SciChart? Currently I’m logging all handled and unhandled exceptions in my app to my server so that issues can be flagged without users having to manually submit support tickets. SciChart is printing internal exceptions to console – is there any way to override that with our own error handling mechanism? If not, how should we monitor for production errors generated internally by SciChart?
Thanks
- Mike Liu asked 6 years ago
- last active 6 years ago
I hope you can help me I have managed to change the font color, size, but I do not know how to put the annotation with underlined font, who could give me a clue please. I would like to get something like what is shown in the image I attached. Thanks in advance.
- Julio Olivos asked 7 years ago
- last active 7 years ago
I noticed that there are two debugging perspectives in Eclipse that are set for Android development.
Why two?
What does DDMS perspective do that Debug perspective does not?
To clarify, I’m only interested in the diff comparison table, not the complete list of DDMS functions.
Session.StatusCallback cannot be resolved for type – Facebook API
Can’t debug via eclipse on the phone with Jelly Bean
What does the use of “.” Without an object in Android (or java)?
Launching TriggerIO Android ForgeInspector
Android Maven in Eclipse – creating an activity
I’m also curious to know why the people who developed DDMS didn’t add it to the Debug perspective, but chose to implement it as an independent perspective.
- Kirsten Hickman asked 3 years ago
Hello!
I’m trying to migrate OhlcDataSeries from Double to more accurate BigDecimal on Android.
But I faced with an issue that “GenericClass doesn’t support class”
How can I fix it?
I want to use BigDecimal with chart.
Thank you
- Roman Z asked 3 years ago
- last active 3 years ago
I want to change the color of the fill bellow the chart(with blue using line chart,FastMountainRenderableSeries etc) but I have problem with defining the BrushStyle and it wont apply on chart(issue with color define-initPaint).Should I change the function ?or how to change default area color ?
- Guest asked 8 years ago
- last active 8 years ago
Hello Friends ,
Sync two Chart in Android Bottom chart can be change on top chart touch
We are looking a solution where we want show two chart at Top and Bottom in Android Screen.based on Top chart changed by gesture /finger touch should be expend/shrink like zoom in and out bottom chart
Assume at top chart data range has between 0 to 3,00,000 , I want to capture in bottom chart only selected/touched part in with expanded form.
I have attached below screen shot which may be helpful.
Solution can be like this but not able to get code for this implementation
https://blog.scichart.com/content/images/2021/06/Navigate-ECG-strip-with-Pocket-ECM.gif
https://blog.scichart.com/android-app-to-view-long-term-ecg-signals/
I appreciate any help regarding this issue.
- vasim simform asked 3 years ago
- last active 2 years ago
Hello.
I am working on Xamarin Android project with C#. Since having a legend within the chart causes problems with too many axis’ (no scrolling is available thus selecting different series in a legend becomes unavailable) and having a legend outside of chart area, anywhere we desire, would be of a preference, is there a tutorial on how could I achieve such a thing? Our project needs this functionality for both Android and iOS.
Would be grateful if anyone could help out with this issue.
Thank you in advance!
- pauzu asked 5 years ago
- last active 5 years ago
I try to make a text formatting for my chart on IOS and Android, regarding your documentation:
IOS:
https://www.scichart.com/documentation/ios/current/axis-labels—textformatting-and-cursortextformatting.html
yAxis.textFormatting = “$0.0”
Android:
https://www.scichart.com/documentation/android/current/Axis%20Labels%20-%20TextFormatting%20and%20CursorTextFormatting.html
yAxis.setTextFormatting(“$0.0000”);
I checked my code and its the same like yours. On Android i have:
// yAxis filed with type IAxis
private IAxis yAxis;
// create
yAxis = sciChartBuilder
.newNumericAxis()
.withGrowBy(0.01d, 0.1d)
.withDrawLabels(true)
.withDrawMajorGridLines(true)
.withDrawMinorGridLines(false)
.withDrawMajorBands(false)
.withDrawMajorTicks(false)
.build();
// the set textFormatting:
yAxis.setTextFormatting(“$0.0000”);
On IOS i have:
var yAxis: SCINumericAxis?
self.yAxis = SCINumericAxis()
self.yAxis?.textFormatting = “$0.0”
But it is not working, can you tell me please why? What I’m doing wrong?
- Alexander Kishchak asked 3 years ago
- last active 3 years ago
Hi,
I have 3 separate line series and 1 column bar series. Whenever I switch between activities, Column bar data and range persist but not for the line series.
Whenever I return back from activityB to ActivityA it never calls restoreInstanceState. How can I persist the states of these graph?
Snap short attached for reference.
—–code,
initChartUI() {
SciChartBuilder.init(mContext)
sciChartBuilder = SciChartBuilder.instance()
xyIapDataSeries =
sciChartBuilder.newXyDataSeries(Date::class.javaObjectType, Short::class.javaObjectType)
.withSeriesName(getString(R.string.label_iap)).build()
xyTempDataSeries =
sciChartBuilder.newXyDataSeries(Date::class.javaObjectType, Short::class.javaObjectType)
.withSeriesName(getString(R.string.label_temperature)).build()
xyUoDataSeries =
sciChartBuilder.newXyDataSeries(Date::class.javaObjectType, Short::class.javaObjectType)
.withSeriesName(getString(R.string.label_uo)).build()
xyRrDataSeries =
sciChartBuilder.newXyDataSeries(Date::class.javaObjectType, Short::class.javaObjectType)
.withSeriesName(getString(R.string.label_respiratory_rate)).build()
initChartIap(iap_chart)
initChartUo(uo_chart)
initChartTemp(temperature_chart)
initChartRR(resp_rate_chart)
}
private fun initChartIap(surface: SciChartSurface) {
val xAxis = sciChartBuilder.newCategoryDateAxis()
.withBarTimeFrame(SECONDS_IN_FIVE_MINUTES.toDouble())
.withDrawMinorGridLines(false)
.withGrowBy(0.0, 0.5)
.build()
val yAxis = sciChartBuilder.newNumericAxis().withAutoRangeMode(AutoRange.Always).build()
val line = sciChartBuilder.newLineSeries().withStrokeStyle(R.color.accuryn_blue, STROKE_THICKNESS)
.withDataSeries(xyIapDataSeries).build()
// Create a Stroke Pen and assign it
val strokePen = SolidPenStyle(resources.getColor(R.color.accuryn_blue, null), true, 2f, null)
line.strokeStyle = strokePen
UpdateSuspender.using(surface) {
Collections.addAll(surface.xAxes, xAxis)
Collections.addAll(surface.yAxes, yAxis)
Collections.addAll<BaseRenderableSeries>(surface.renderableSeries, line)
Collections.addAll<AxisMarkerAnnotation>(surface.annotations, iapAxisMarker)
Collections.addAll(
surface.chartModifiers, sciChartBuilder.newModifierGroup()
.withXAxisDragModifier().build()
.withZoomPanModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build()
.withPinchZoomModifier().build()
.build()
)
}
……
rest 3 other types….
…..
override fun onSaveInstanceState(outState: Bundle) {
outState.run {
putInt("count", xyIapDataSeries.count)
putInt("uoCount", xyUoDataSeries.count)
putInt("tempCount", xyTempDataSeries.count)
putInt("rrCount", xyRrDataSeries.count)
val iapRange = iap_chart.xAxes[0].visibleRange
val uoRange = uo_chart.xAxes[0].visibleRange
val tempRange = temperature_chart.xAxes[0].visibleRange
val rrRange = resp_rate_chart.xAxes[0].visibleRange
putDouble("rangeIapMin", iapRange.getMinAsDouble())
putDouble("rangeIapMax", iapRange.getMaxAsDouble())
putDouble("rangeUoMin", uoRange.getMinAsDouble())
putDouble("rangeUoMax", uoRange.getMaxAsDouble())
putDouble("rangeTempMin", tempRange.getMinAsDouble())
putDouble("rangeTempMax", tempRange.getMaxAsDouble())
putDouble("rangeRrMin", rrRange.getMinAsDouble())
putDouble("rangeRrMax", rrRange.getMaxAsDouble())
}
super.onSaveInstanceState(outState)
}
override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)
updateIapData(savedInstanceState)
updateUoData(savedInstanceState)
updateTempData(savedInstanceState)
updateRRData(savedInstanceState)
}
override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
super.onRestoreInstanceState(savedInstanceState)
updateIapData(savedInstanceState)
updateUoData(savedInstanceState)
updateTempData(savedInstanceState)
updateRRData(savedInstanceState)
}
private fun updateIapData(savedInstanceState: Bundle?) {
UpdateSuspender.using(iap_chart) {
var count = DEFAULT_POINT_COUNT
if (savedInstanceState != null) {
count = savedInstanceState.getInt(“count”)
val rangeMin = savedInstanceState.getDouble("rangeIapMin")
val rangeMax = savedInstanceState.getDouble("rangeIapMax")
iap_chart.xAxes[0].visibleRange.setMinMaxDouble(rangeMin, rangeMax)
}
val iap = mutableListOf<Short>()
val date = mutableListOf<Date>()
for (entry in mSimplifiedDataList) {
if (entry.emr.iap > 0) {
iap.add(entry.emr.iap)
date.add(Date(DateTimeUtils.toEpochMilli(entry.getRtcTimeStamp())))
} else {
iap.add(0)
date.add(Date(DateTimeUtils.toEpochMilli(entry.getRtcTimeStamp())))
}
}
tv_iap_input_data.text = iap[iap.size.minus(1)].toString()
xyIapDataSeries.append(date, iap)
}
}
……rest other for updating data over UI.
- Praween Kumar asked 5 years ago
- last active 5 years ago