I have created a HeatMap with the size of 25000 x 70. The application crashes with the following log:
E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
I/OpenGLRenderer: Initialized EGL, version 1.4
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without…
D/EGL_emulation: eglCreateContext: 0x7faef90b6500: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x7faef90b6500: ver 2 0 (tinfo 0x7faf0489eec0)
D/EGL_emulation: eglMakeCurrent: 0x7faef90b6500: ver 2 0 (tinfo 0x7faf0489eec0)
D/EGL_emulation: eglCreateContext: 0x7faf04b65680: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x7faf04b65680: ver 2 0 (tinfo 0x7faf04b7e500)
E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glTexImage2D:1908 GL error 0x501 A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x41a10f90 in tid 2736 (GLThread 973)
Below is Kotlin code from my sample project that produces the error:
private const val WIDTH = 25000
private const val HEIGHT = 70
class MainActivity : AppCompatActivity()
{
private lateinit var chartBuilder: SciChartBuilder
override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate(savedInstanceState)
SciChartSurface.setRuntimeLicenseKey(getString(R.string.sciChart_license))
SciChartBuilder.init(this)
chartBuilder = SciChartBuilder.instance()
setContentView(R.layout.activity_main)
val background = findViewById<ViewGroup>(R.id.background)
val chartSurface = createChartSurface()
background.addView(chartSurface)
addPoints(chartSurface)
}
private fun createChartSurface(): SciChartSurface
{
val surface = SciChartSurface(this)
val xAxis = chartBuilder.newNumericAxis().build()
val yAxis = chartBuilder.newNumericAxis().build()
surface.xAxes.add(xAxis)
surface.yAxes.add(yAxis)
surface.renderableSeries.add(createSeries(WIDTH, HEIGHT))
return surface
}
private fun createSeries(width: Int, height: Int): FastUniformHeatmapRenderableSeries
{
val dataSeries = UniformHeatmapDataSeries(Int::class.javaObjectType, Int::class.javaObjectType, Float::class.javaObjectType, width, height)
return chartBuilder.newUniformHeatmap()
.withColorMap(ColorMap(intArrayOf(ColorUtil.DarkBlue, ColorUtil.CornflowerBlue, ColorUtil.DarkGreen, ColorUtil.Chartreuse, ColorUtil.Yellow, ColorUtil.Red), floatArrayOf(0f, 0.2f, 0.4f, 0.6f, 0.8f, 1f)))
.withDataSeries(dataSeries)
.build()
}
private fun addPoints(chartSurface: SciChartSurface)
{
@Suppress("UNCHECKED_CAST")
val dataSeries = chartSurface.renderableSeries.first().dataSeries as UniformHeatmapDataSeries<Int, Int, Float>
val xRange = 0 until WIDTH
for (i in 0 until HEIGHT)
{
val values = xRange.map { (i + it).toFloat() }
dataSeries.updateRangeZAt(0, i, values)
}
val renderableSeries = chartSurface.renderableSeries.first() as FastUniformHeatmapRenderableSeries
renderableSeries.minimum = dataSeries.zValues.minimum.toDouble()
renderableSeries.maximum = dataSeries.zValues.maximum.toDouble()
}
}
- MIha Rozina asked 6 years ago
- last active 2 years ago
I created demo project using SurfaceMeshRenderableSeries3D but there is bugs or glitch. I have click listener.
image.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (value == 0) {
layout.setVisibility(View.GONE);
value = 1;
} else {
value = 0;
layout.setVisibility(View.VISIBLE);
}
}
});
Above is basic GONE and VISIBLE logic, when i click image first time layout view is gone and SciChartSurface3D get full screen below is xml code.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/image"
android:src="@mipmap/ic_launcher_round"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:background="@color/design_default_color_secondary_variant"
android:visibility="visible"
android:orientation="vertical"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="100dp"/>
<com.scichart.charting3d.visuals.SciChartSurface3D
android:id="@+id/chart3d"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
My issues is when i click image the Scichart is getting full but with some black screen glitch, I attach before and after click event images.
Thanks in advance i am waiting for your answer.
- Tushar Sawant asked 2 years ago
- last active 2 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 3 years ago
- last active 3 years ago
Attempt to invoke interface method ‘com.scichart.data.model.IRange com.scichart.charting.visuals.axes.IAxisCore.getVisibleRange()’ on a null object reference
Getting above error while testing tooltip in 3DChart .First time tooltip work but second time after added new data in 3DChart tooltip crash.
- Tushar Sawant asked 3 years ago
Hi.
I have a line chart where i add data continuously from different sensors.
The code looks like this
protected open fun setupChart() {
surface = requireView().findViewById(R.id.sciChartId)
xAxis = NumericAxis(context).apply {
autoRange = AutoRange.Always
drawMajorGridLines = false
drawMajorBands = false
drawMinorGridLines = false
}
yAxis = NumericAxis(context).apply {
drawMajorGridLines = false
drawMajorBands = false
drawMinorGridLines = false
axisAlignment = AxisAlignment.Left
// axisId ="First id"
}
dataSeries1 = XyDataSeries(Double::class.javaObjectType, Double::class.javaObjectType).apply {
seriesName = "Line A"
acceptsUnsortedData = true
}
val line1Color = Color.BLACK // ColorUtil.argb(0xFF, 0xFF, 0xFF, 0x00)
val line1 = FastLineRenderableSeries().apply {
strokeStyle = SolidPenStyle(line1Color, true, 1F, null)
dataSeries = dataSeries1
// yAxisId = "SecondId"
}
val legendModifier = LegendModifier(context).apply {
setLegendPosition(Gravity.TOP or Gravity.START, 16)
setOrientation(Orientation.VERTICAL)
setSourceMode(SourceMode.AllSeries)
}
series.add(line1)
UpdateSuspender.using(surface) {
surface.xAxes.add(xAxis)
surface.yAxes.add(yAxis)
// surface.yAxes.add(yAxisTwo)
surface.renderableSeries.addAll(series)
surface.chartModifiers.add(legendModifier)
surface.setBackgroundColor(Color.WHITE)
series.forEach {
AnimationsHelper.createAnimator(
it,
SweepXyTransformation(XyRenderPassData::class.java),
3000,
350,
DecelerateInterpolator(),
FloatEvaluator(),
0f,
1f
).start()
}
}
addXAxisDragModifier()
addZoomPanModifier()
addZoomExtentModifier()
addPinchZoom()
surface.zoomExtents()
}
And the code adding data looks like this
dataSeries1.append(value, someOtherValue)
I understand that zooming is not possible when you set AutoRange to Always.
However i have not seen any working example where zooming is enabled at the same time as you add data continually.
Is it possible to zoom at all with real time without setting autoRange and if yes can you refer to any working example you have
- Arbon Vata asked 3 years ago
- last active 3 years ago
thank you for answer !
Additional questions
image is attached
q1. last data only marker
q2. vertical dotted line (with rolloverModifier)
- young kwang kwon asked 3 years ago
- last active 3 years ago
Hi team,
Im using scicharts inside recyclerview and for some reasons im getting out of memory exception while loading or scrolling through the list.I’m not getting the issue everytime the page loads though.Is there something to do with optimization. The sample size to load the charts are high actually
- Vinu Gilbert asked 3 years ago
- last active 3 years ago
q1. How do I change the rollovermodifier’s vertical line to a dotted line?rolloverModifier.getVerticalLinePaint().setStyle(Paint.Style.STROKE);This source doesn’t seem to work
q2. I wonder how to display markers only on the last data of the line chart.
q3. I am wondering how to make the background transparent, how to make the grid transparent on the background.
- young kwang kwon asked 3 years ago
- last active 3 years ago
Hi team,
In my app,i’m using a custom rollover modifier as tool tip.I am representing y axis value (numerical value) in tooltip.I would like to have decimal places upto 3 digits in tooltip.do you have any suggestion to how i could achieve this. i’m attaching current screenshot along with this question.
Thanks
Vinu Gilbert
- Vinu Gilbert asked 3 years ago
- last active 3 years ago
Hello,
As you have already the examples of the EEG -50 channel, Is it possible to set the sensitivity factor for the channels to show the graph.
Basically, this will set the amplitude based on the frequency variation example 7micro volts/millimeter (7microvolts/mm) for each channel. Is there any way we can do it using Scichart, please let us know.
Appreciate your help
Regards,
Aditya
- Aditya Kadambi asked 3 years ago
- last active 3 years ago
When I work with the 2D Android Heatmap Chart, I want to draw a frame on the borders of the cells. Is this possible?
Thanks already for your help.
- MUSTAFA KELSAKA 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,
I’m probably missing something obvious, but how can I change the font/colors of JUST the scichart legend (not axes labels or other text) in Android.
Thank you.
- C Bolton asked 3 years ago
- last active 3 years ago
I am working on the spectrogram (heatmap) that can be interacted with fingers. It can only pan horizontally, and the Z values from heatmap will be updated whenever panning stopped.
I override onUp function from ZoomPanModifier to fetch the latest x range, which is temporarily logged by VisiableRangeChangeListener. But the issue is, when I’m panning with the finger horizontally, the chart will always be moving a little bit after onUp() occurred. So there’s a difference between the desired x range and actual x range.
Is there a way to get the final x range after a panning action?
Thanks.
- Gang Xu asked 4 years ago
- last active 3 years ago
Hi
I have added 24 Line graphs for EEG. Now I want to display the name of each channels against each graph. I am using Y steeped graph which you are using for Vital signs display in example code. Can you please let me know how to t to display the name of each channels against each graph
Best Regards,
Aditya
- Aditya Kadambi 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
Hi,
Can you please tell me how to show an annotation(extends at BoxAnnotation(x1, y1, 2, y2)) that starts at a certain point(x1, y1) and ends at the end of the chart. That is, the starting point (x1) is known, and the end point (x2) at the very end of the surface (graph)?
Thanks in advance.
Regards,
Batyr
- Batyr Batyr asked 3 years ago
- last active 3 years ago
Hi,
Can you please tell me how to change selection points of annotation?
Thanks in advance.
Regards,
Batyr
- Batyr Batyr asked 3 years ago
- last active 3 years ago
I’ve recently found out that for some particular charts ,the series is not completely visible for top and bottom most parts of the chart.I need to drag the axis to see those portions.do you any suggestions for this issue.I’ll attach some ss.
Thanks in Advance
- Vinu Gilbert asked 3 years ago
- last active 3 years ago
We are adding 24 channel data Live graph using Scichart Example of Vital sign monitor. We are using VitalSignsMonitorShowcaseFragment.java example.
To show the live graph, do we need to accumulate the data for 50 point or so. I see in the code they are accumulating?
Is it necessary for the accumulation, please let us know
protected void initExample(ExampleVitalSignsMonitorFragmentBinding binding) {
final DefaultVitalSignsDataProvider dataProvider = new DefaultVitalSignsDataProvider(getActivity());
setUpChart(dataProvider);
dataProvider.getData().buffer(50, TimeUnit.MILLISECONDS).doOnNext(ecgData -> {
if(ecgData.isEmpty()) return;
dataBatch.updateData(ecgData);
UpdateSuspender.using(binding.surface, () -> {
final DoubleValues xValues = dataBatch.xValues;
ecgDataSeries.append(xValues, dataBatch.ecgHeartRateValuesA);
ecgSweepDataSeries.append(xValues, dataBatch.ecgHeartRateValuesB);
bloodPressureDataSeries.append(xValues, dataBatch.bloodPressureValuesA);
bloodPressureSweepDataSeries.append(xValues, dataBatch.bloodPressureValuesB);
bloodOxygenationDataSeries.append(xValues, dataBatch.bloodOxygenationA);
bloodOxygenationSweepDataSeries.append(xValues, dataBatch.bloodOxygenationB);
bloodVolumeDataSeries.append(xValues, dataBatch.bloodVolumeValuesA);
bloodVolumeSweepDataSeries.append(xValues, dataBatch.bloodVolumeValuesB);
final VitalSignsData lastVitalSignsData = dataBatch.lastVitalSignsData;
final double xValue = lastVitalSignsData.xValue;
lastEcgSweepDataSeries.append(xValue, lastVitalSignsData.ecgHeartRate);
lastBloodPressureDataSeries.append(xValue, lastVitalSignsData.bloodPressure);
lastBloodOxygenationSweepDataSeries.append(xValue, lastVitalSignsData.bloodOxygenation);
lastBloodVolumeDataSeries.append(xValue, lastVitalSignsData.bloodVolume);
});
}).compose(bindToLifecycle()).subscribe();
updateIndicators(0);
Observable.interval(0, 1, TimeUnit.SECONDS, AndroidSchedulers.mainThread())
.doOnNext(this::updateIndicators)
.compose(bindToLifecycle()).subscribe();
}
- Aditya Kadambi asked 3 years ago
- last active 3 years ago
Hi, I’ve trying to run the charts in emulator and it works fine with recyclerview ,but when i try to render chart in a fragment it doesn’t shows.The same fragment render charts in device and issue with emulator.I’m using geny motion. Thanks in Advance
- Vinu Gilbert asked 3 years ago
- last active 3 years ago
Hi,
Can you please tell me do you have tool like https://www.scichart.com/documentation/win/current/webframe.html#Fibonacci%20Retracement%20Drawing%20Tool.html
on Android?
If not, please give me a sample code on how to implement this with scichart.
Thanks in advance.
Regards,
Batyr
- Batyr Batyr asked 3 years ago
- last active 3 years ago
Hi,
I,ve added ZoomExtentsModifier(), PinchZoomModifier() to the chart modifier.I want these modifiers on Xaxis only not on YAxis.Is possible to remove these modifiers on one axis.My requirement is that, during pinchzoom yaxis value needs to be constant
- Vinu Gilbert asked 3 years ago
- last active 3 years ago
Hi, I’ve been working on recyclerview with scichart.The problem i’m facing is that sometimes,when you come back from other screens the charts is not loading eventhough the other data in the list are showing.The list is placed inside a view pager .This issue is not consistant sometimes it shows the graph sometimes it won’t .The exception i’m getting are
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child’s parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:5260)
at android.view.ViewGroup.addView(ViewGroup.java:5089)
2021-08-17 14:50:52.639 15073-29533/com.fascilityconnex.voicemobile E/SciChart Rendering Errors: SciChartSurface has no XAxes. Please ensure SciChartSurface.XAxis is set, or SciChartSurface.XAxes has at least one axis
2021-08-17 14:50:52.641 15073-29531/com.fascilityconnex.voicemobile E/Exception: null
java.lang.UnsupportedOperationException: AxisCollection.getAxisById(‘DefaultAxisId’) returned more than one axis with the ID=DefaultAxisId. Please check you have assigned correct axis Ids when you have multiple axes in SciChart
at com.scichart.charting.model.AxisCollection.getAxisById(SourceFile:10)
- Vinu Gilbert asked 3 years ago
- last active 3 years ago
I would like to add scroll listener on x axis title. Is it possible to add scroll to axis title
- Vinu Gilbert asked 3 years ago
- last active 3 years ago
When I open the activity with the chart , I see a black screen. And there is no graph displayed.
I have a trial license key which is valid.
Here is my full code:
xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/chart_layout"
android:orientation="vertical">
Activity:
public class ECGMonitorFragment extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
com.scichart.charting.visuals.SciChartSurface.setRuntimeLicenseKey("");
} catch(Exception e){
Log.e("SciChart", "Error while accesing the license", e);
}
setContentView(R.layout.activity_ecgmonitor_fragment);
// Create a SciChartSurface
final SciChartSurface surface = new SciChartSurface(this);
// Get a layout declared in "activity_main.xml" by id
LinearLayout chartLayout = (LinearLayout) findViewById(R.id.chart_layout);
// Add the SciChartSurface to the layout
chartLayout.addView(surface);
// Initialize the SciChartBuilder
SciChartBuilder.init(this);
// Obtain the SciChartBuilder instance
final SciChartBuilder sciChartBuilder = SciChartBuilder.instance();
// Create a numeric X axis
final IAxis xAxis = sciChartBuilder.newNumericAxis()
.withAxisTitle("X Axis Title")
.withVisibleRange(-5, 15)
.build();
// Added in Tutorial #8 - two Y axes
// Create a numeric axis, right-aligned
final IAxis yAxisRight = sciChartBuilder.newNumericAxis()
.withAxisTitle("Primary")
// Assign a unique ID to the axis
.withAxisId("primaryYAxis")
.withAxisAlignment(AxisAlignment.Right)
.build();
// Create another numeric axis, left-aligned
final IAxis yAxisLeft = sciChartBuilder.newNumericAxis()
.withAxisTitle("Secondary")
// Assign a unique ID to the axis
.withAxisId("secondaryYAxis")
.withAxisAlignment(AxisAlignment.Left)
.withGrowBy(0.2,0.2)
.build();
// Add both Y axes to the YAxes collection of the surface
Collections.addAll(surface.getYAxes(), yAxisLeft, yAxisRight);
// Added in Tutorial #3
// Add a bunch of interaction modifiers to a ModifierGroup
ModifierGroup chartModifiers = sciChartBuilder.newModifierGroup()
// Setting MotionEventsGroup
.withMotionEventsGroup("SharedMotionEvents").withReceiveHandledEvents(true)
.withPinchZoomModifier().build()
.withZoomPanModifier().withReceiveHandledEvents(true).build()
.withZoomExtentsModifier().withReceiveHandledEvents(true).build()
.withXAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Scale).withClipModeX(ClipMode.None).build()
.withYAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Pan).build()
.build();
// Add the X axis to the XAxes collection of the surface
Collections.addAll(surface.getXAxes(), xAxis);
// Add the interactions to the ChartModifiers collection of the surface
Collections.addAll(surface.getChartModifiers(), chartModifiers);
// Added in Tutorial #6 - FIFO (scrolling) series
// Create a couple of DataSeries for numeric (Int, Double) data
// Set FIFO capacity to 500 on DataSeries
final int fifoCapacity = 500;
final XyDataSeries lineData = sciChartBuilder.newXyDataSeries(Integer.class, Double.class)
.withFifoCapacity(fifoCapacity)
.build();
final XyDataSeries scatterData = sciChartBuilder.newXyDataSeries(Integer.class, Double.class)
.withFifoCapacity(fifoCapacity)
.build();
// Create and configure a line series
final IRenderableSeries lineSeries = sciChartBuilder.newLineSeries()
.withDataSeries(lineData)
// Register on a particular Y axis using its ID
.withYAxisId("primaryYAxis")
.withStrokeStyle(ColorUtil.LightBlue, 2f, true)
.build();
// Create an Ellipse PointMarker for the Scatter Series
EllipsePointMarker pointMarker = sciChartBuilder
.newPointMarker(new EllipsePointMarker())
.withFill(ColorUtil.LightBlue)
.withStroke(ColorUtil.Green, 2f)
.withSize(10)
.build();
// Create and configure a scatter series
final IRenderableSeries scatterSeries = sciChartBuilder.newScatterSeries()
.withDataSeries(scatterData)
// Register on a particular Y axis using its ID
.withYAxisId("primaryYAxis")
.withPointMarker(pointMarker)
.build();
// Add a RenderableSeries onto the SciChartSurface
surface.getRenderableSeries().add(scatterSeries);
surface.getRenderableSeries().add(lineSeries);
surface.zoomExtents();
// Added in Tutorial #5
// Create a LegendModifier and configure a chart legend
ModifierGroup legendModifier = sciChartBuilder.newModifierGroup()
.withLegendModifier()
.withOrientation(Orientation.HORIZONTAL)
.withPosition(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 10)
.build()
.build();
// Add the LegendModifier to the SciChartSurface
surface.getChartModifiers().add(legendModifier);
// Create and configure a CursorModifier
ModifierGroup cursorModifier = sciChartBuilder.newModifierGroup()
// Setting MotionEventsGroup
.withMotionEventsGroup("SharedMotionEvents").withReceiveHandledEvents(true)
.withCursorModifier().withShowTooltip(true).build()
.build();
// Add the CursorModifier to the SciChartSurface
surface.getChartModifiers().add(cursorModifier);
// Added in Tutorial #9 - one more SciChartSurface
final SciChartSurface surface2 = new SciChartSurface(this);
// Add the SciChartSurface to the layout
chartLayout.addView(surface2);
// Set layout parameters for both surfaces
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f);
surface.setLayoutParams(layoutParams);
surface2.setLayoutParams(layoutParams);
// Create a numeric X axis
final IAxis xAxis2 = sciChartBuilder.newNumericAxis()
.withAxisTitle("X Axis Title")
.withVisibleRange(-5, 15)
.build();
// Create a numeric axis
final IAxis yAxisRight2 = sciChartBuilder.newNumericAxis()
.withAxisTitle("Primary")
.withAxisId("primaryYAxis")
.withAxisAlignment(AxisAlignment.Right)
.build();
// Create another numeric axis
final IAxis yAxisLeft2 = sciChartBuilder.newNumericAxis()
.withAxisTitle("Secondary")
.withAxisId("secondaryYAxis")
.withAxisAlignment(AxisAlignment.Left)
.withGrowBy(0.2, 0.2)
.build();
// Add the Y axis to the YAxes collection of the surface
Collections.addAll(surface2.getYAxes(), yAxisLeft2, yAxisRight2);
// Add the X axis to the XAxes collection of the surface
Collections.addAll(surface2.getXAxes(), xAxis2);
// Create and configure an area series
final IRenderableSeries areaSeries = sciChartBuilder.newMountainSeries()
.withDataSeries(scatterData)
.withYAxisId("primaryYAxis")
.withStrokeStyle(ColorUtil.LightBlue, 2f, true)
.withAreaFillColor(ColorUtil.argb(ColorUtil.LightSteelBlue, 0.6f))
.build();
// Add the area series to the RenderableSeries collection of the surface
Collections.addAll(surface2.getRenderableSeries(), areaSeries);
// Create the second collection of chart modifiers
ModifierGroup chartModifiers2 = sciChartBuilder.newModifierGroup()
// Setting MotionEventsGroup
.withMotionEventsGroup("SharedMotionEvents").withReceiveHandledEvents(true)
.withZoomExtentsModifier().withReceiveHandledEvents(true).build()
.withZoomPanModifier().withReceiveHandledEvents(true).build()
.withPinchZoomModifier().withReceiveHandledEvents(true).build()
.withCursorModifier().withReceiveHandledEvents(true).build()
.build();
// Add the interactions to the ChartModifiers collection of the surface
Collections.addAll(surface2.getChartModifiers(), chartModifiers2);
TimerTask updateDataTask = new TimerTask() {
private int x = 0;
@Override
public void run() {
UpdateSuspender.using(surface, new Runnable() {
@Override
public void run() {
lineData.append(x, Math.sin(x * 0.1));
scatterData.append(x, Math.cos(x * 0.1));
// Added in Tutorial #7
// Add an annotation every 100 data points
if(x%100 == 0) {
TextAnnotation marker = sciChartBuilder.newTextAnnotation()
// Register on a particular Y axis using its ID
.withYAxisId("primaryYAxis")
.withIsEditable(false)
.withText("N")
.withBackgroundColor(ColorUtil.Green)
.withX1(x)
.withY1(0.0)
.withVerticalAnchorPoint(VerticalAnchorPoint.Center)
.withHorizontalAnchorPoint(HorizontalAnchorPoint.Center)
.withFontStyle(20, ColorUtil.White)
.withZIndex(1)
.build();
surface.getAnnotations().add(marker);
// Remove one annotation from the beginning
// in the FIFO way
if(x > fifoCapacity){
surface.getAnnotations().remove(0);
}
}
// Zoom series to fit the viewport
surface.zoomExtents();
surface2.zoomExtents();
++x;
}
});
}
};
Timer timer = new Timer();
long delay = 0;
long interval = 10;
timer.schedule(updateDataTask, delay, interval);
}
}
- Aditya Kadambi asked 3 years ago
- last active 3 years ago
I’m trying to add custom layout to the tooltip modifier ,but i couldn’t find the solution , also i would like to change the crosshair type behavior on the tool tip ,instead of that i would like to add my own style
- Vinu Gilbert asked 3 years ago
- last active 3 years ago
Hi,
I am trying to add text annotation on the chart but it doesn’t show. I’m wondering what went wrong with my code.
TextAnnotation textAnnotation = sciChartBuilder.newTextAnnotation()
.withText("hello")
.withX1(450)
.withY1(1)
.withFontStyle(20, Color.WHITE)
.build();
ecgSurface.getAnnotations().add(textAnnotation);
- Gang Xu asked 3 years ago
- last active 3 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’d like to learn how to cancel creating annotation in the OnAnnotationCreatedListener(). Thanks.
annotationCreationModifier.setAnnotationCreationListener(new OnAnnotationCreatedListener() {
@Override
public void onAnnotationCreated(IAnnotation iAnnotation) {
if (outofbound) {
// remove current annotation
}
}
- Gang Xu asked 3 years ago
- last active 3 years ago
Hi,
I want to change the colormap so that the:
– minimum (blue) = 4095
– maximum (red) = 800
Also, I want to set 0 to either black or transparent.
I can easily change the min and max values, just wanting to change the color limit and set 0 = black.
Here is my code for creating the heatmap:
public void heatmap(){
// Create a SciChartSurface
SciChartSurface surface = new SciChartSurface(this);
// Get a layout declared in "activity_main.xml" by id
LinearLayout chartLayout = findViewById(R.id.chart_layout);
// Add the SciChartSurface to the layout
chartLayout.addView(surface);
// Initialize the SciChartBuilder
SciChartBuilder.init(this);
// Obtain the SciChartBuilder instance
final SciChartBuilder sciChartBuilder = SciChartBuilder.instance();
final NumericAxis xAxis = sciChartBuilder.newNumericAxis()
.withGrowBy(0.1, 0.1)
.build();
final NumericAxis yAxis = sciChartBuilder.newNumericAxis()
.withGrowBy(0.1, 0.1)
.build();
final FastUniformHeatmapRenderableSeries heatmapRenderableSeries = sciChartBuilder.newUniformHeatmap()
.withMinimum(4095)
.withMaximum(800)
.withCellTextStyle(sciChartBuilder.newFont().withTextSize(8).withTextColor(ColorUtil.White).build())
.withDrawTextInCell(true)
.withDataSeries(createDataSeries())
.build();
final SciChartSurface chart = surface;
Collections.addAll(chart.getXAxes(), xAxis);
Collections.addAll(chart.getYAxes(), yAxis);
Collections.addAll(chart.getRenderableSeries(), heatmapRenderableSeries);
Collections.addAll(chart.getChartModifiers(), sciChartBuilder.newModifierGroupWithDefaultModifiers().build());
}
- Jazz Adams asked 3 years ago
- last active 3 years ago
So far what I know about Scichart is only their given examples, They are really great, what worries me now before I apply for any realtime cryptocurrency data API, I would like to know how to integrate the API to my chart so that I get real time data. If there is any example code with API recommendations I would really appreciate.
- Matthew Mataruse asked 3 years ago
- last active 3 years ago
Hi,
I am new to SciChart and have followed the instructions of tutorial 2 to my own app.
I imported all libraries and then added the code to display a surface (as in tutorial 2) into a layout however nothing displays.
Notes:
– I have activated my license
– If I attempt to run the tutorial 2 code off GitHub the app crashes and no errors displayed in the log.
- Jazz Adams asked 3 years ago
From your examples on Github all of them requires databinding which is giving me serious problems. I am running into databinding errors, would you happen to have solutions to that?
- Matthew Mataruse asked 3 years ago
- last active 3 years ago
Hello there. At the beginning of the program, I define the workspace as w=10 and h=10 units. I set the new workspace to 5×5 in a button event. The new workspace is created but the old 10×10 volume remains on the screen. When I create the new workspace I want the old one to disappear. Thank you in advance for your help. Good work.
My button event.
btnSetNewWH.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
w = 5;
h = 5;
ds3d = new UniformGridDataSeries3D<>(Double.class, Double.class, Double.class, w, h);
rs1 = sciChart3DBuilder.newSurfaceMeshSeries3D()
.withDataSeries(ds3d)
.withDrawMeshAs(DrawMeshAs.SolidWireframe)
.withStroke(0xFFE0E0E0)
.withStrokeThicknes(1f)
.withMaximum(5000)
.withDrawSkirt(false)
.withMeshColorPalette(new GradientColorPalette(colors, stops))
.withOpacity(1.0f)
.build();
surface3d.setTheme(R.style.SciChart_ElectricStyle);
surface3d.setCamera(camera);
surface3d.setXAxis(xAxis);
surface3d.setYAxis(yAxis);
surface3d.setIsFpsCounterVisible(false);
surface3d.setZAxis(zAxis);
surface3d.getRenderableSeries().add(rs1);
surface3d.getChartModifiers().add(sciChart3DBuilder.newModifierGroupWithDefaultModifiers().build());
}
});
- MUSTAFA KELSAKA asked 3 years ago
- last active 3 years ago
We want to create loop graph in android wrap data
- Vishal Juneja 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
Hi,
I have a valid license key for development. But occasionally the charts show the message below and I have to restart the app to avoid that. May I ask is there a reason for that and how to fix it?
"Sorry! You have not set a License Key. You can request a free trial key from www.scichart.com/licensing-scichart-android or purchase at store.scichart.com."
Thanks,
Gang
- Gang Xu asked 3 years ago
- last active 3 years ago
Hi,
How can we turn the light off and on in 3D drawings in Android studio?
Best regards…
- MUSTAFA KELSAKA asked 3 years ago
- last active 3 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,
Today, I tried https://github.com/ABTSoftware/SciChart.Xamarin.Forms repository to my project. ColumnRenderableSeries3D is missing, so I was added by manually. But now I stuck.
I can’t change column width and color.
I know, Xamarin forms actually in plan, but somehow someone can help me, if I share my whole code?
I Attached my image.
- Qx Development asked 3 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
Hello,
I have a problem with the 3D surface chart. I have used the 3D example from the Example Tutorial as an example. As soon as I make xSize and ySize larger than 128, a gap appears in the respective axes.
Is it possible that these sizes are limited? Or have I made a mistake?
In the attachment you will find the resulting pictures.
The good one has an xSize and ySize of 128 and the bad one 129.
- Willi Schüler asked 3 years ago
- last active 3 years ago
i recently saw documentation about compositeannotation in wpf
do you have same version for android?
how to combine all annotation as one annotation?
- Yuda Susanto asked 3 years ago
- last active 3 years ago
My chart is dynamic, adding data from the right side all the time, and scrolling the chart to the left. Now the chart can manually scroll to the right indefinitely, but there are many blank areas on the right side. What can I do to limit the range of scrolling to the right? Is there any way to limit the zoom ratio to prohibit the chart from scrolling to the right indefinitely?
- WU GUANGYU asked 3 years ago
- last active 3 years ago
My chart is dynamic, adding data from the right side all the time, and scrolling the chart to the left. Now the chart can manually scroll to the right indefinitely, but there are many blank areas on the right side. What can I do to limit the range of scrolling to the right? Is there any way to limit the zoom ratio to prohibit the chart from scrolling to the right indefinitely?
- WU GUANGYU asked 3 years ago
Hi, I just want to make sure
everything inside com.scichart.charting.visual will be considered as VIEW in MVVM pattern right?
thanks
- Yuda Susanto asked 3 years ago
- last active 3 years ago
In Scichart Android version 4.2.0.4557, ICategoryLabelProvider.transformDataToIndex(Date var1); accept date as parameter
but at version 4.2.0.4608, int transformDataToIndex(double var1); it accept double?
then how to convert date to double?
and another question.
-
how set start tick axis in category date axis?
what i see here first tick of x axis always come with data, not like date axis which data can adapt their position itself. -
how to set time frame in date axis like category date axis?
-
without scichart builder i cannot set time frame in categorydateaxis
- Yuda Susanto asked 3 years ago
- last active 3 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
Referring to the stacked column side by side example in the android examples collection, if someone clicks on a column/series in that chart, how could i identify which the of columns has been selected (usa, china, india, etc).
- Marcus Maringer asked 3 years ago
- last active 3 years ago