Pre loader

Category: Android

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0 votes
6k views

I’m not sure what is going on, but I am consistently getting an error about my trial license key not being valid (it has 28 days left)

Error msg: “Sorry! You have not set a License Key. You can request a free trial key from http://www.scichart.com...”

Code (trial key partially snipped):

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    // Set this code once in MainActivity or application startup
    SciChartSurface.setRuntimeLicenseKey("w2q0iyS8UeR2HKF...uqUbxqjprSIvXJPibCSl1g6ag==")

    // Get the scichartsurface
    val surface = findViewById<com.scichart.charting.visuals.SciChartSurface>(R.id.id_scichartsurface)
    // Initialize the SciChartBuilder
    SciChartBuilder.init(this)
    // Obtain the SciChartBuilder instance
    val sciChartBuilder = SciChartBuilder.instance()
    // Create a numeric X axis
    val xAxis: IAxis = sciChartBuilder.newNumericAxis()
        .withAxisTitle("X Axis Title")
        .withVisibleRange(-5.0, 15.0)
        .build()
    // Create a numeric Y axis
    val yAxis: IAxis = sciChartBuilder.newNumericAxis()
        .withAxisTitle("Y Axis Title").withVisibleRange(0.0, 100.0).build()
    // Create a TextAnnotation and specify the inscription and position for it
    val textAnnotation = sciChartBuilder.newTextAnnotation()
        .withX1(5.0)
        .withY1(55.0)
        .withText("Hello World!")
        .withHorizontalAnchorPoint(HorizontalAnchorPoint.Center)
        .withVerticalAnchorPoint(VerticalAnchorPoint.Center)
        .withFontStyle(20f, ColorUtil.White)
        .build()
    // Create interactivity modifiers
    val chartModifiers = sciChartBuilder.newModifierGroup()
        .withPinchZoomModifier().withReceiveHandledEvents(true).build()
        .withZoomPanModifier().withReceiveHandledEvents(true).build()
        .build()
    // Add the Y axis to the YAxes collection of the surface
    Collections.addAll(surface.yAxes, yAxis)
    // Add the X axis to the XAxes collection of the surface
    Collections.addAll(surface.xAxes, xAxis)
    // Add the annotation to the Annotations collection of the surface
    Collections.addAll(surface.annotations, textAnnotation)
    // Add the interactions to the ChartModifiers collection of the surface
    Collections.addAll(surface.chartModifiers, chartModifiers)
}

Any assistance appreciated. Thank you.

  • C Bolton asked 4 years ago
  • last active 3 years ago
0 votes
6k views

Hi all,

Upfront apologies – I suspect this is a bit of a complicated set of information I’m looking for, as the UI specs are rather strict on what we’re looking for.

I’m getting to the last few functionalities I need to test, and I believe I’ve proof of concepted nearly everything I need. and I suspect I know what needs to be customized for my requirements. I wasn’t exactly sure how to implement some parts though, and the documentation for the android tick provider suggested that I look for assistance.

https://www.scichart.com/documentation/android/v2.x/webframe.html#Axis%20Ticks%20-%20TickProvider%20and%20DeltaCalculator%20API.html

My remaining goals are to have an X-axis that is…

  1. X-axis is above and below the top and bottom charts. I figure I can handle this dynamically by setting the axis visibility to true depending on which charts are visible – should be easy.

  2. X-axis needs to be on 1 hour ticks (on the hour). The zoom range will go from 3 hours to 72 hours, and I will limit the pan to the nearest hour prior and after the current data. I assume I need to override tick provider. The x axis should look like 12:00 AM, 1:00 AM, 2:00 AM, 3:00 AM, and so forth. If the zoom is at 72 hours, it’ll show something like 12:00AM, 3:00AM, etc. I don’t think this part needs to be customized, and will automatically be handled by the default delta provider (Unless I’m mistaken, I can just specify max number of ticks on screen somewhere, and it’ll handle accordingly). – This one seems rather complicated.

  3. I’d like to display the date on the 12:00AM entries of the x axis. As such, each “12:00 AM” tick will have “Jan 1” below it or the like. -Not sure how feasible this one is, and may push back on this requirement and skip it if it’s not doable.

Do you have an example of how to implement a custom tick provider/have any suggestions (also – please let me know if I’m barking up the wrong tree and I should be taking an entirely different approach).

Thanks!
-Andy

0 votes
6k views

Hi Guys,

I am implementing the column chart, but the xAxis value is duplicate when I scroll the chart. Please see the images attachment.

Here are the piece of code, and wandering what cause this, thx!

package com.refinitiv.android.presentation.view.chart.stack

import android.content.Context
import android.util.AttributeSet
import android.view.Gravity
import android.widget.FrameLayout
import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat

import com.scichart.charting.ClipMode
import com.scichart.charting.Direction2D
import com.scichart.charting.model.ChartModifierCollection
import com.scichart.charting.model.dataSeries.IXyDataSeries
import com.scichart.charting.modifiers.AxisDragModifierBase
import com.scichart.charting.modifiers.XAxisDragModifier
import com.scichart.charting.modifiers.ZoomPanModifier
import com.scichart.charting.numerics.labelProviders.NumericLabelFormatter
import com.scichart.charting.numerics.labelProviders.NumericLabelProvider
import com.scichart.charting.numerics.tickProviders.NumericTickProvider
import com.scichart.charting.visuals.SciChartSurface
import com.scichart.charting.visuals.axes.AutoRange
import com.scichart.charting.visuals.axes.AxisTickLabelStyle
import com.scichart.charting.visuals.axes.IAxis
import com.scichart.charting.visuals.renderableSeries.IRenderableSeries
import com.scichart.charting.visuals.renderableSeries.StackedColumnRenderableSeries
import com.scichart.charting.visuals.renderableSeries.VerticallyStackedColumnsCollection
import com.scichart.core.framework.UpdateSuspender
import com.scichart.core.model.DoubleValues
import com.scichart.core.model.IntegerValues
import com.scichart.data.model.DoubleRange
import com.scichart.drawing.canvas.RenderSurface
import com.scichart.drawing.common.FontStyle
import com.scichart.drawing.common.PenStyle
import com.scichart.drawing.common.SolidPenStyle
import com.scichart.extensions.builders.SciChartBuilder
import timber.log.Timber
import java.util.*
import kotlin.math.roundToInt

private const val GROW_BY: Double = 0.0

private const val MAX_VISIBLE_COLUMNS = 11
private const val MIN_VISIBLE = -0.5

class StackColumnChartView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet?,
defStyleAttr: Int = 0,
defStyleRes: Int = 0
) : FrameLayout(context, attrs, defStyleAttr, defStyleRes) {

private val chart = SciChartSurface(context)


private val typefaceSemibold =
    ResourcesCompat.getFont(context, R.font.proxima_nova_fin_semibold)

private val tickFontStyle = FontStyle(
    typefaceSemibold,
    resources.getDimension(R.dimen.chart_axis_text_size),
    getColorFromAttrOrDefault(R.attr.chartAxisTextColor, R.color.dove_grey),
    true
)

private val majorGridLineAndTickStyle: PenStyle = SolidPenStyle(
    getColorFromAttrOrDefault(R.attr.cardViewItemDividerBackground, R.color.desert_storm_50),
    true,
    resources.getDimension(R.dimen.chart_grid_line_thickness),
    null
)

var xAxisLabelList = emptyList<String>()
var yAxisLabelList = mutableListOf("0%", "20%", "40%", "60%", "80%", "100%")
var dataList: List<List<Double>> = emptyList()
private lateinit var xAxisData: List<Double>

init {
    chart.renderSurface = RenderSurface(context)
    val params = LayoutParams(
        LayoutParams.MATCH_PARENT,
        LayoutParams.MATCH_PARENT
    )
    chart.layoutParams = params

    addView(chart)
    chart.theme = R.style.SciChart
}

fun buildChart() {
    Timber.tag("CHART").d("CURVE CHART View build chart")
    SciChartBuilder.init(context)
    val sciChartBuilder: SciChartBuilder = SciChartBuilder.instance()
    xAxisData = xAxisLabelList.mapIndexed { index, _ ->
        index.toDouble()
    }
    val xAxis = initXAxis(sciChartBuilder)
    val yAxis = initYAxis(sciChartBuilder)
    val dataSeries = initDataSeries(context, sciChartBuilder)

    val surfaceChartModifiers: ChartModifierCollection = chart.chartModifiers
    val zoomPanModifier = ZoomPanModifier()
    zoomPanModifier.direction = Direction2D.XDirection
    zoomPanModifier.clipModeX = ClipMode.ClipAtExtents
    zoomPanModifier.clipModeY = ClipMode.None
    zoomPanModifier.zoomExtentsY = false

    val dragModifier = XAxisDragModifier()
    dragModifier.dragMode = AxisDragModifierBase.AxisDragMode.Pan
    surfaceChartModifiers.add(dragModifier)

    UpdateSuspender.using(chart) {
        chart.xAxes.clear()
        chart.yAxes.clear()
        chart.annotations.clear()
        chart.renderableSeries.clear()

        Collections.addAll(chart.xAxes, xAxis)
        Collections.addAll(chart.yAxes, yAxis)
        Collections.addAll(chart.renderableSeries, dataSeries)

        Collections.addAll(chart.chartModifiers, zoomPanModifier)
        Collections.addAll(chart.chartModifiers, dragModifier)
    }
}

fun clearChart() {
    UpdateSuspender.using(chart) {
        chart.xAxes.clear()
        chart.yAxes.clear()
        chart.annotations.clear()
        chart.renderableSeries.clear()
    }
}

private fun initDataSeries(
    context: Context, sciChartBuilder: SciChartBuilder
): IRenderableSeries {

    val verticalCollection = VerticallyStackedColumnsCollection()

    val seriesList = dataList.mapIndexed { _, xValue ->
        val series: IXyDataSeries<Double, Double> = sciChartBuilder.newXyDataSeries(
            Double::class.javaObjectType,
            Double::class.javaObjectType
        ).build()
        for (i in xAxisData.indices) {
            series.append(xAxisData[i], xValue[i])
        }
        series
    }


    val result = seriesList.mapIndexed { index, series ->
        val color: Int = if (index < colorList.size) {
            ContextCompat.getColor(context, colorList[index])
        } else {
            ContextCompat.getColor(context, colorList[index % colorList.size])
        }
        val stack: StackedColumnRenderableSeries =
            sciChartBuilder.newStackedColumn().withDataSeries(series).withFillColor(color)
                .withStrokeStyle(
                    ContextCompat.getColor(
                        context, R.color.chatline_white
                    ), 0.2F
                )
                .build()
        stack
    }

    verticalCollection.addAll(result)
    verticalCollection.dataPointWidth = 0.4
    verticalCollection.isOneHundredPercent = true
    return verticalCollection
}

private fun initXAxis(
    sciChartBuilder: SciChartBuilder
): IAxis {

    val horizontalAxisTickLabelStyle = AxisTickLabelStyle(
        Gravity.CENTER_VERTICAL,
        0,
        context.resources.getDimensionPixelSize(R.dimen.pe_firm_investment_profile_chat_view_label_margin_vertical),
        0,
        0,
    )
    val visibleMin = if (xAxisLabelList.size > MAX_VISIBLE_COLUMNS) {
        (xAxisLabelList.size - MAX_VISIBLE_COLUMNS).toDouble()
    } else {
        MIN_VISIBLE
    }
    val xVisibleRange = DoubleRange(visibleMin, (xAxisLabelList.size + MIN_VISIBLE))
    return sciChartBuilder
        .newNumericAxis()
        .build()
        .apply {
            axisTickLabelStyle = horizontalAxisTickLabelStyle
            tickLabelStyle = tickFontStyle
            drawMinorGridLines = false
            drawMinorTicks = false
            drawMajorTicks = false
            drawMajorBands = false
            drawMajorGridLines = false
            autoFitMarginalLabels = true
            visibleRange = xVisibleRange

// tickProvider = XTickProvider(xAxisData)
labelProvider =
NumericLabelProvider(FirmProfileDateAxisLabelFormatter(xAxisLabelList))
growBy = DoubleRange(GROW_BY, GROW_BY)
maxAutoTicks = xAxisLabelList.size
}
}

private fun initYAxis(
    sciChartBuilder: SciChartBuilder
): IAxis {
    val verticalAxisTickLabelStyle = AxisTickLabelStyle(
        Gravity.CENTER_HORIZONTAL,
        0,
        0,
        0,
        0
    )

    return sciChartBuilder
        .newNumericAxis()
        .build()
        .apply {
            axisTickLabelStyle = verticalAxisTickLabelStyle
            drawMajorGridLines = true
            minimalZoomConstrain = 0.0
            tickLabelStyle = tickFontStyle
            majorTickLineStyle = majorGridLineAndTickStyle
            majorGridLineStyle = majorGridLineAndTickStyle
            labelProvider = FirmProfileYAxisLabelProvider(yAxisLabelList)
            autoRange = AutoRange.Always
            maxAutoTicks = yAxisLabelList.size
            growBy = DoubleRange(GROW_BY, GROW_BY)
        }
}

fun dispose() {
    SciChartBuilder.dispose()
}

class XTickProvider(private val xAxisData: List<Double>) : NumericTickProvider() {
    override fun updateCullingPriorities(
        cullingPriorities: IntegerValues?,
        majorTicks: DoubleValues?
    ) {
        super.updateCullingPriorities(cullingPriorities, majorTicks)
    }
    override fun updateTicks(minorTicks: DoubleValues?, majorTicks: DoubleValues?) {

// super.updateTicks(minorTicks, majorTicks)
xAxisData.forEach {
majorTicks?.add(it)
}
}

    override fun getMajorTickIndex(tick: Double): Int {
        Timber.tag("StackColumn").v("getMajorTickIndex-:${tick}")
        return super.getMajorTickIndex(tick)
    }

    override fun shouldUpdateTicks(): Boolean {
       val should = super.shouldUpdateTicks()
        Timber.tag("StackColumn").v("shouldUpdateTicks-:${should}")
        return should
    }

    override fun isFirstMajorTickEven(majorTicks: DoubleValues?): Boolean {
        return super.isFirstMajorTickEven(majorTicks)
    }
}

class FirmProfileDateAxisLabelFormatter(private val labelTitles: List<String>) :
    NumericLabelFormatter() {

    private var lastFormatLabel = ""

    override fun formatLabel(p0: Double): CharSequence {
        Timber.tag("StackColumn").v("formatLabel-:${p0}")
        if (labelTitles[p0.toInt()] == lastFormatLabel) {
            return ""
        }
        return labelTitles[p0.toInt()]
    }

    override fun formatCursorLabel(p0: Double): CharSequence {

        return formatLabel(p0)
    }

}

class FirmProfileYAxisLabelProvider(private val labelList: List<String>) :
    NumericLabelProvider() {
    var index = 0
    override fun formatLabel(p0: Double): CharSequence {
        if (labelList.isEmpty()) {
            return ""
        }
        val title = labelList[index]
        index += 1
        index = if (index < labelList.size) {
            index
        } else {
            0
        }
        return title
    }

    override fun formatCursorLabel(p0: Double): CharSequence {
        return formatLabel(p0)
    }
}

companion object {
    val colorList = mutableListOf(
        R.color.chatline_blue_ribbon,
        R.color.chatline_black,
        R.color.chatline_teal,
        R.color.chatline_butterfly,
        R.color.chatline_olive,
        R.color.chatline_grenadier,
        R.color.chatline_rain_forest,
        R.color.chatline_cerise_red,
        R.color.chatline_scorpion,
        R.color.chatline_jelly_bean,
        R.color.chatline_genoa,
        R.color.chatline_brown_rust,
        R.color.chatline_torea_bay,
        R.color.chatline_saddle_brown,
        R.color.chatline_victoria,
        R.color.chatline_sherpa_blue,
        R.color.chatline_oregon,
        R.color.chatline_kaitoke_green,
        R.color.chatline_maroon_flush,
        R.color.chatline_tundora,
        R.color.chatline_chathams_blue,
        R.color.chatline_eden,
        R.color.chatline_mule_fawn,
    )
}

}

  • Steve Shan asked 2 years ago
  • last active 2 years ago
0 votes
11k views

我想实现一个功能,需要改变选中区域里面的几根蜡烛颜色为除了涨跌之外的其他颜色,整个功能该怎么实现?

0 votes
7k views

I have an error after update Android Stutio to version 3.1
But project is steel builds and run successfully

0 votes
9k views

hi,
I am currently trying to implement a chart with a category datetime axis. I custom a label formatter for handling a custom datetime format, let say”yyyy/MM”. Only the 1st tick of each year will display the label.
Eg: data with[“2018/1”,“2018/3”,“2018/5”], only show 2018/1, others show with empty/no label

I find the overrided method of label and cursor label formatter have only returned Comparable object which should be only returned the current rederering datetime axis label’s date.
Is there any way to find the previous one label to compare or any suggestion for implement this axis? Thank you!

  • may lym asked 6 years ago
  • last active 6 years ago
0 votes
14k views

chart screenshot

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

0 votes
6k views

Hello everyone.

I have a candlestick chart with date x-axis and double y-axis.
While scrolling to the left im loading past history and showing it – everything works fine.

Once i have below crash:

What can cause it?
Can not find anything in google.

01-22 10:23:31.490 28770-28770/com.test.livedataperformance E/InputEventReceiver: Exception dispatching input event.
01-22 10:23:31.490 28770-28770/com.test.livedataperformance D/AndroidRuntime: Shutting down VM
01-22 10:23:31.490 28770-28770/com.test.livedataperformance E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.test.livedataperformance, PID: 28770
java.lang.UnsupportedOperationException: Unsupported search mode
at com.scichart.data.model.SciListUtil.longFindIndex(Native Method)
at com.scichart.data.model.SciListUtil.a(SourceFile:39)
at com.scichart.data.model.SciListUtil$b.findIndex(SourceFile:3044)
at com.scichart.data.model.SciListFactory$i.a(SourceFile:3141)
at com.scichart.data.model.SciListFactory$i.findIndex(SourceFile:3126)
at com.scichart.charting.model.dataSeries.XDataSeries.a(SourceFile:273)
at com.scichart.charting.model.dataSeries.XDataSeries.getIndicesXRange(SourceFile:241)
at com.scichart.charting.model.dataSeries.XDataSeries.getWindowedYRange(SourceFile:208)
at com.scichart.charting.visuals.renderableSeries.BaseRenderableSeries.getYRange(SourceFile:1027)
at com.scichart.charting.visuals.axes.rangeCalculators.RangeCalculationHelperBase.getWindowedYRange(SourceFile:225)
at com.scichart.charting.visuals.axes.AxisBase.getWindowedYRange(SourceFile:1098)
at com.scichart.charting.visuals.SciChartSurface.a(SourceFile:1116)
at com.scichart.charting.visuals.SciChartSurface.zoomExtentsY(SourceFile:1167)
at com.scichart.charting.modifiers.ZoomPanModifier.a(SourceFile:202)
at com.scichart.charting.modifiers.ZoomPanModifier.onScroll(SourceFile:176)
at android.view.GestureDetector.onTouchEvent(GestureDetector.java:619)
at com.scichart.charting.modifiers.GestureModifierBase.onTouch(SourceFile:80)
at com.scichart.charting.modifiers.ModifierGroup.onTouch(SourceFile:189)
at com.scichart.core.utility.touch.MotionEventManager.c(SourceFile:140)
at com.scichart.core.utility.touch.MotionEventManager.a(SourceFile:39)
at com.scichart.core.utility.touch.MotionEventManager$a$1.a(SourceFile:224)
at com.scichart.core.utility.touch.MotionEventManager$a$1.execute(SourceFile:221)
at com.scichart.core.utility.touch.MotionEventManager$a.a(SourceFile:211)
at com.scichart.core.utility.touch.MotionEventManager$a.onTouchEvent(SourceFile:183)
at com.scichart.charting.visuals.SciChartSurface.onTouchEvent(SourceFile:1251)
at android.view.View.dispatchTouchEvent(View.java:9300)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2547)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2240)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
at android.app.Activity.dispatchTouchEvent(Activity.java:2812)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
at android.view.View.dispatchPointerEvent(View.java:9520)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4242)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4095)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3641)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3694)
at android.view.ViewRootImpl$InputStage.forward(ViewRoo

0 votes
7k views

Hello.

I have found out that calling suspendUpdate() and resumeUpdate() on a SciChartSurface object allocates memory that is never released. The allocations get bigger with more data in the chart.

I have created an empty Android project. I have added a SciChartSurface and a Button. Pressing the button suspends and resumes updates. You can then see in the Android Monitor that after each press of the button the memory consumption of the app increases. Since the chart is empty the allocations are very small but still noticeable. I have attached the zip of the example project.

Kotlin code of the Activity in the project:

class MainActivity : AppCompatActivity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val layout = findViewById(R.id.layout) as ConstraintLayout

        val chartSurface = SciChartSurface(this)
        layout.addView(chartSurface)

        val button = findViewById(R.id.button) as Button
        button.setOnClickListener {
            val suspender = chartSurface.suspendUpdates()
            chartSurface.resumeUpdates(suspender)
        }
    }
}

I

P.S.:
I have tried to open a priority ticket, but I got the following error:

We encountered a problem (cross-site request forgery detected); please try again
Sorry, we encountered a problem (invalid department). Please start over.

0 votes
10k views

Hi, from the attached screenshot, we can see that the axis marker is somehow overlapped the chart content. I would like to ask how to resize the annotation so that we can fix this issue? thanks.

  • Ray Hung asked 6 years ago
  • last active 6 years ago
0 votes
5k views

I want to draw one of the first picture, but FastLineRenderableSeriesBuilder found no fill color Settings, do you have other solution?

0 votes
0 answers
1k views

An alpha value of 100% is clearly visible. But at 40% it looks too blurry. Is there a solution?


My Theme

<style name="SciChart_Alpha" parent="SciChart_BaseStyle">
    <item name="sciChartBackground">@drawable/sci_chart_alpha_bg</item>
    <item name="majorGridLinesColor">@android:color/transparent</item>
    <item name="minorGridLineColor">@android:color/transparent</item>
</style>

sci_chart_alpha_bg.xml

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >
    <solid android:color="#FFFFFF" />
</shape>

My Example Chart

surface.suspendUpdates {
    theme = R.style.SciChart_Alpha

    xAxes {
        numericAxis { }
    }
    yAxes {
        numericAxis {
            autoRange = AutoRange.Always
            growBy = DoubleRange(0.2, 0.2)
        }
    }
    renderableSeries {
        fastLineRenderableSeries {
            xyDataSeries<Double, Double> {
                seriesName = "LINE1"
                repeat(100) {
                    append(it.toDouble(), Random.nextDouble(10.0, 20.0))
                }
            }
            // alpha 100%
            strokeStyle = SolidPenStyle(0xFFF57C00)
        }
        fastLineRenderableSeries {
            xyDataSeries<Double, Double> {
                seriesName = "LINE2"
                repeat(100) {
                    append(it.toDouble(), Random.nextDouble(10.0, 20.0))
                }
            }
            // alpha 40%
            strokeStyle = SolidPenStyle(0x6626C6DA)
        }
        fastLineRenderableSeries {
            xyDataSeries<Double, Double> {
                seriesName = "LINE3"
                repeat(100) {
                    append(it.toDouble(), Random.nextDouble(10.0, 20.0))
                }
            }
            // alpha 40%
            strokeStyle = SolidPenStyle(0x667E57C2)
        }
        fastBandRenderableSeries {
            xyyDataSeries<Double, Double> {
                seriesName = "BAND"
                repeat(100) {
                    append(
                        it.toDouble(),
                        Random.nextDouble(10.0, 20.0),
                        Random.nextDouble(10.0, 20.0)
                    )
                }
            }
            // alpha 60%
            strokeStyle = SolidPenStyle(0x99FFCC80)
            // alpha 60%
            strokeY1Style = SolidPenStyle(0x99FFCC80)
            // alpha 5%
            fillBrushStyle = SolidBrushStyle(0x0DFFCC80)
            // alpha 5%
            fillY1BrushStyle = SolidBrushStyle(0x0DFFCC80)
        }
    }
    chartModifiers {
        xAxisDragModifier {
            receiveHandledEvents = true
            dragMode = AxisDragModifierBase.AxisDragMode.Pan
        }
        pinchZoomModifier {
            receiveHandledEvents = true
            direction = Direction2D.XDirection
        }
        zoomPanModifier { receiveHandledEvents = true }
        rolloverModifier {}
    }
}

LineRenderable ColumnRenderable Example

class AlphaPaletteProvider :
PaletteProviderBase(FastColumnRenderableSeries::class.java),
IFillPaletteProvider, IStrokePaletteProvider {

companion object {
    private val colorAlpha00 = ColorUtil.argb(0x00, 0xFF, 0xCC, 0x80) // 0%
    private val colorAlpha1A = ColorUtil.argb(0x1A, 0xFF, 0xCC, 0x80) // 10%
    private val colorAlpha33 = ColorUtil.argb(0x33, 0xFF, 0xCC, 0x80) // 20%
    private val colorAlpha4D = ColorUtil.argb(0x4D, 0xFF, 0xCC, 0x80) // 30%
    private val colorAlpha66 = ColorUtil.argb(0x66, 0xFF, 0xCC, 0x80) // 40%
    private val colorAlpha80 = ColorUtil.argb(0x80, 0xFF, 0xCC, 0x80) // 50%
    private val colorAlpha99 = ColorUtil.argb(0x99, 0xFF, 0xCC, 0x80) // 60%
    private val colorAlphaB3 = ColorUtil.argb(0xB3, 0xFF, 0xCC, 0x80) // 70%
    private val colorAlphaCC = ColorUtil.argb(0xCC, 0xFF, 0xCC, 0x80) // 80%
    private val colorAlphaE6 = ColorUtil.argb(0xE6, 0xFF, 0xCC, 0x80) // 90%
    private val colorAlphaFF = ColorUtil.argb(0xFF, 0xFF, 0xCC, 0x80) // 100%
}

private val colors = IntegerValues(
    intArrayOf(
        colorAlpha00,
        colorAlpha1A,
        colorAlpha33,
        colorAlpha4D,
        colorAlpha66,
        colorAlpha80,
        colorAlpha99,
        colorAlphaB3,
        colorAlphaCC,
        colorAlphaE6,
        colorAlphaFF
    )
)

override fun update() {}

override fun getFillColors(): IntegerValues = colors

override fun getStrokeColors(): IntegerValues = colors

}


class AlphaChart {
companion object {
private val colorAlpha00 = ColorUtil.argb(0x00, 0xFF, 0xCC, 0x80) // 0%
private val colorAlpha1A = ColorUtil.argb(0x1A, 0xFF, 0xCC, 0x80) // 10%
private val colorAlpha33 = ColorUtil.argb(0x33, 0xFF, 0xCC, 0x80) // 20%
private val colorAlpha4D = ColorUtil.argb(0x4D, 0xFF, 0xCC, 0x80) // 30%
private val colorAlpha66 = ColorUtil.argb(0x66, 0xFF, 0xCC, 0x80) // 40%
private val colorAlpha80 = ColorUtil.argb(0x80, 0xFF, 0xCC, 0x80) // 50%
private val colorAlpha99 = ColorUtil.argb(0x99, 0xFF, 0xCC, 0x80) // 60%
private val colorAlphaB3 = ColorUtil.argb(0xB3, 0xFF, 0xCC, 0x80) // 70%
private val colorAlphaCC = ColorUtil.argb(0xCC, 0xFF, 0xCC, 0x80) // 80%
private val colorAlphaE6 = ColorUtil.argb(0xE6, 0xFF, 0xCC, 0x80) // 90%
private val colorAlphaFF = ColorUtil.argb(0xFF, 0xFF, 0xCC, 0x80) // 100%
}

fun initAlphaChart(surface: SciChartSurface) {
    surface.suspendUpdates {
        theme = R.style.SciChart_Alpha

        xAxes {
            numericAxis {
                autoRange = AutoRange.Always
                growBy = DoubleRange(0.1, 0.1)
            }
        }
        yAxes {
            numericAxis {
                autoRange = AutoRange.Always
                growBy = DoubleRange(0.2, 0.2)
            }
        }
        renderableSeries {
            fastColumnRenderableSeries {
                createDataSeries(2.0)
                paletteProvider = AlphaPaletteProvider()
            }
            fastLineRenderableSeries {
                createDataSeries(3.0)
                strokeStyle = SolidPenStyle(colorAlpha00, 2f) // 0%
            }
            fastLineRenderableSeries {
                createDataSeries(3.1)
                strokeStyle = SolidPenStyle(colorAlpha1A, 2f) // 10%
            }
            fastLineRenderableSeries {
                createDataSeries(3.2)
                strokeStyle = SolidPenStyle(colorAlpha33, 2f) // 20%
            }
            fastLineRenderableSeries {
                createDataSeries(3.3)
                strokeStyle = SolidPenStyle(colorAlpha4D, 2f) // 30%
            }
            fastLineRenderableSeries {
                createDataSeries(3.4)
                strokeStyle = SolidPenStyle(colorAlpha66, 2f) // 40%
            }
            fastLineRenderableSeries {
                createDataSeries(3.5)
                strokeStyle = SolidPenStyle(colorAlpha80, 2f) // 50%
            }
            fastLineRenderableSeries {
                createDataSeries(3.6)
                strokeStyle = SolidPenStyle(colorAlpha99, 2f) // 60%
            }
            fastLineRenderableSeries {
                createDataSeries(3.7)
                strokeStyle = SolidPenStyle(colorAlphaB3, 2f) // 70%
            }
            fastLineRenderableSeries {
                createDataSeries(3.8)
                strokeStyle = SolidPenStyle(colorAlphaCC, 2f) // 80%
            }
            fastLineRenderableSeries {
                createDataSeries(3.9)
                strokeStyle = SolidPenStyle(colorAlphaE6, 2f) // 90%
            }
            fastLineRenderableSeries {
                createDataSeries(4.0)
                strokeStyle = SolidPenStyle(colorAlphaFF, 2f) // 100%
            }
        }
        chartModifiers {
            xAxisDragModifier {
                receiveHandledEvents = true
                dragMode = AxisDragModifierBase.AxisDragMode.Pan
            }
            pinchZoomModifier {
                receiveHandledEvents = true
                direction = Direction2D.XDirection
            }
            zoomPanModifier { receiveHandledEvents = true }
            rolloverModifier {}
        }
    }
}

fun createDataSeries(yValues: Double): XyDataSeries<Int, Double> {
    return XyDataSeries<Int, Double>().apply {
        for (index in 1..10) {
            append(index, yValues)
        }
    }
}

}

0 votes
0 answers
13k views

issue resolved….it happened due to late initialization of super class instance for context.

0 votes
7k views

Please help me on this, as I want to draw/combine multiple charts on a single surface and I am getting Json values from Api & also attaching the Graph look which I want.

Help me how I can achieve this.

Thanks in advance.

0 votes
4k views

Does Sci chart has any framework to support UI Automation in Android/iOS? Also I came across some screenshot based test for verification, Is this available for licensed user to test in Android/iOS?

0 votes
7k views

Hi,
I am using Sci Chart android I want to Share/Link Custom Modifier on Multiple Charts ,
How Can i do that?

  • sci chart asked 5 years ago
  • last active 4 years ago
0 votes
7k views

Can Annotation in editing state set the editing style, or the background of editing state?

0 votes
2k views

Hello,

I am having trouble determining the parameters to pass to ModifierTouchEventArgs when overriding GestureModifierBase in the latest SciChart versions. I can’t figure out where to get the now required source and target values – the super class returns null when asked.. Code snippet below…

class MyCustomGestureModifier() : GestureModifierBase() {
    override fun onLongPress(e: MotionEvent?) {
    super.onLongPress(e)

    /* This worked in SciChart v4.2.0.4557, but no longer does due to ModifierTouchEvents now requiring source and target
    val args = ModifierTouchEventArgs()
    args.e = e
    args.isHandled = false
    args.isMaster = true
    args.isInSourceBounds = true
     */

    // create touch event args for rollover modifier
    // 4.3.0.4646 wants additional parameters for source and target
    val orgEvent = originalTouchEvent // this is null, so where should we get source and target?
    val args = ModifierTouchEventArgs(orgEvent.source, orgEvent.target)
    args.e = e
    args.isHandled = false

    rolloverModifier.onTouch(args)

    args.clear()
}

In case it helps, the above snippet is based on a previous discussion at https://www.scichart.com/questions/android/separating-rollover-tootips-and-pan-drag

Thank you.

  • C Bolton asked 2 years ago
  • last active 2 years ago
0 votes
0 answers
5k views

I am working on the CreateMultiPaneStockChartFragment example. I modified the example, like showing legend checkboxes and some other stuff. I am getting the following exception, but just sometimes (like 30% of time). It happens as soon as I open the fragment.

2019-02-19 12:32:59.551 12534-12534/com.yyyyy.xxxE/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.yyyyy.xxxE, PID: 12534
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.get(ArrayList.java:437)
        at com.scichart.charting.visuals.legend.SciChartLegend$d.a(SourceFile:278)
        at com.scichart.charting.visuals.legend.SciChartLegend$c.run(SourceFile:338)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Obviously there is some problem with get() on an empty ArrayList, but I am having a hard time to debug where exactly this happens.

I have reviewed my source code multiple times and can not find the cause. What could be the problem?

I am using v2.2.1.2391.

  • Primoz asked 5 years ago
  • last active 5 years ago
0 votes
7k views

I am using StackedColumnRenderableSeries and I have a problem when a data is displayed as it shows the incomplete graph as the second attached image.
Thank you

var xAxis = new DateAxis(this)
{
GrowBy = new DoubleRange(0.1, 0.1),
AxisTitle = “”,
AutoRange = AutoRange.Always,
TextFormatting = “MMM yyyy”,
DrawMajorGridLines = false,
DrawMinorGridLines = false,
AxisBandsStyle = new SolidBrushStyle(0xfff9f9f9),
};

0 votes
0 answers
6k views

Can I get a scroll offset of a chart and scroll a horizontal recycler simultaneously with the same offset?

0 votes
8k views

We are working on an android based ELD application. We are looking for a ELD graph. Is it possible to accomplish this using SCICHART?

0 votes
8k views

I have CategoryDateAxis and whant to setup range limit from series size – 50 to series size + 10

mBottomAxis.setVisibleRangeLimit(new DoubleRange(series.size() - 50d, series.size() + 10d));
mBottomAxis.setVisibleRangeLimitMode(RangeClipMode.MinMax);

And this code works but not as I expected
When I scrol chalt and hits the range limit scroll is stopped BUT chart is zooming in

How to disable zooming when I hits the limit?

0 votes
7k views

Hi, I would like to ask how can I draw Renko and 3 Line Break Chart using SciChart API ? thanks.

  • Ray Hung asked 7 years ago
  • last active 7 years ago
0 votes
6k views

Hi,
I want to customize the style of stick such that
1. Green and hollow stick if it is rising and open higher than close
2. Green and fill stick if it is rising and open lower than close
3. Red and hollow stick if it is falling and open higher than close
4. Red and fill stick if it is falling and open lower than close

How could i achieve that with only one candle series?

  • tommy ng asked 6 years ago
  • last active 6 years ago
0 votes
3k views

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);

}

}

0 votes
7k views

Hello,

I’m trying to figure out how to apply a consistent gradient to the areas underneath my line charts. For example, if I have chart with Y values 0-10, I might want the area corresponding to 0 to be white, and 10 to be black, regardless of what values are currently panned or zoomed onto the screen. From what I have seen so far, SciChart gradients are based on the current screen values, so if I were zoomed into an area that was only 0-5, it would should a white to black gradient (not what I want), whereas I need a white to grey variant (reserving the black for 10’s). I hope that makes sense.

Thank you.

  • C Bolton asked 4 years ago
  • last active 4 years ago
0 votes
7k views

I used box annotation like pic
in a boxAnnotation I used

.withIsEditable(true)
.withPosition(1,-2, 0, 2)
.withBackgroundDrawableId(R.drawable.example_box_annotation_background_4)
.withResizingGrip(customIResizingGrip)
.withAnnotationDragListener(customIAnnotationSelectionDrawable)
.withResizeDirections(Direction2D.XDirection)
.withDragDirections(Direction2D.XDirection)
.build();

and i made a 2 box like pic

i use box for drag one side to make a box big or small

the first box which is left doesn’t move anywhere.
it just can only drag that i want
but the second box, the box moves when i drag after first touch
the left box never moves on but right box moves first drags
just move first time not sometimes

am i wrong something?

  • Justin Lee asked 4 years ago
  • last active 4 years ago
0 votes
3k views

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

0 votes
8k views

I want to make my labels positions in the centre of axis (y axis which is transparent). Only three labels have to be showed. On the same height with the min, max and actual points. How can I achieve this.

enter image description here

0 votes
3k views

editable box annotation

Hi,

Can you please tell me how to change selection points of annotation?

Thanks in advance.

Regards,
Batyr

0 votes
4k views

I want to maintain shape of scichart minor and major grids as square as shown in image below how can I do that?

  • sci chart asked 5 years ago
  • last active 4 years ago
0 votes
4k views

Hi! I’ve purchased your products including source code. I need to modify some of your code and have tried in many ways, but I have not compiled your source codes successfully. I am working on it on my Mac Osx, using android studio version of Android Gradle Plugin Version 3.1.0 and Gradle Version 4.4. I’ve got these errors, but I could not find any hints to solve this problem from your QnA site and google. The messages are following. Please let me know how to compile your source code properly. The source codes I have is SciChart_Android_v2.5.0.2540_SDK. Thank you for your good products and service.

Build command failed.

Error while executing process /Users/shiwansung/Library/Android/sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/Android.mk NDK_APPLICATION_MK=/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/Application.mk APP_ABI=x86_64 NDK_ALL_ABIS=x86_64 NDK_DEBUG=1 APP_PLATFORM=android-19 NDK_OUT=/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/build/intermediates/ndkBuild/debug/lib -j4 /Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/build/intermediates/ndkBuild/debug/obj/local/x86_64/libdata.so}

[x86_64] Compile++ : data <= SciListUtil.cpp

[x86_64] Compile++ : data <= arrayOperations.cpp

[x86_64] Compile++ : data <= NativePointResamplerFactory.cpp

[x86_64] Compile++ : data <= resampling.cpp

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

MAKE_NATIVE(double, double)

^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: variable has incomplete type ‘void’

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:16: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

           ^

:359:1: note: expanded from here

Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double

^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: expected ‘;’ after top level declarator

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:98: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

                                                                                             ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:28:104: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void JNICALL Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleWithoutReduction(JNIEnv *env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jboolean isCategoryData)\

                                                                                                   ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:33:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:38:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMin(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:43:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMid(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:48:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMaxUnevenlySpaced(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jdouble minXInclusive, jdouble maxXInclusive, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:53:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleInClusterMode(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

MAKE_NATIVE(double, float)

^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:28:104: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void JNICALL Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleWithoutReduction(JNIEnv *env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jboolean isCategoryData)\

                                                                                                   ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:33:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:38:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMin(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:43:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMid(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:48:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMaxUnevenlySpaced(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jdouble minXInclusive, jdouble maxXInclusive, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:53:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleInClusterMode(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:61:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

MAKE_NATIVE(double, short)

^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:61:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:28:104: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void JNICALL Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleWithoutReduction(JNIEnv *env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jboolean isCategoryData)\

                                                                                                   ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:61:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:33:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

0 votes
6k views

Hello support!
I have two questions, I would be very grateful for any information or hint.

  1. What methods can I use to bind a Visual Range to an Axis or Renderable Series to change them synchronously, I need to combine the series on 3 different surfaces.

  2. How can I control the YAxisDragModifier to block the movement of the Visual Range when a certain condition is reached. Thanks.

0 votes
6k views

Hi,

I’m trying to write an app which dynamically hides/shows (Visible/Gone) scichart surface without losing the data rendering. I’ve been trying to drive this via android visiblity and observable fields (MVVM design). An example of how our surfaces look is as follows:

<com.scichart.charting.visuals.SciChartSurface
android:id=”@+id/temperature_chart”
android:layout_width=”match_parent”
android:layout_height=”0dp”
android:layout_weight=”.99″
android:visibility=”@{graphViewModel.displayChartTemp ? View.VISIBLE : View.GONE}”
android:paddingTop=”@dimen/potrero_gap”
android:paddingBottom=”@dimen/potrero_gap”
scichart:verticalGroup=”@{graphViewModel.sharedVG}”
scichart:renderableSeries=”@{graphViewModel.tempRenderableSeries}”
scichart:xAxes=”@{graphViewModel.xTempAxes}”
scichart:yAxes=”@{graphViewModel.yTempAxes}”/>

and in the view model:

declaration:
var displayChartTemp = ObservableBoolean()

and to set the visibility….
displayChartTemp.set(true)
displayChartTemp.set(false)

I saw that historically, one solution was to
rsiChart.setRenderSurface(null);
rsiChart.setRenderSurface(new RenderSurfaceGL(getActivity()));

but I was wondering if there would be a good way to do this with MVVM architecture, and drive it similarly with observables?

Thanks,
-Andy

0 votes
6k views

want to show error marker in line series if data point is bad (isGoodValue=false). how to set metadata in android series

1 vote
9k views

We are testing your Android Example application, andwe are trying to find out the capabilities of the 2d Heatmap chart.

I have found in your documentation that you have the “Heatmap Texture Filtering” feature, anyways I am not able to set it as true in the heatmap plot. (found on the [WPF Heatmap Chart documentation][1 )

Is this feature disabled in Android Charts?

I am trying to enable this filtering, but the modification on your example app does not compile.

I have already tried to modify other stuff on your heatmap example chart, and it works, but particularly in our application we need as a must this kind of feature. It will be finally something that helps us to decide if your SciChart library meet our requirement.

Thanks for your attention,

0 votes
5k views

This is what I want it to look like: (see 1.jpg)

This is what (see 2.jpg) it does look like if I leave setIsLabelCullingEnabled enabled (all labels are culled except if I zoom WAY in)
This is what (see 3.jpg) it does look like if I turn off setIsLabelCullingEnabled

I would expect #2 to look like #3 without either one of the 20/15% and either 1% or 1.25% culled, when culling is enabled.

First things the specific values/locations are precise, I need those lines and labels exactly where they are. So I had to create my own LogarithmicNumericTickProvider and feed it all the numbers; this worked great and the numbers are where they need to be — but apparently using our own LogarithmicNumericTickProvider totally breaks culling. Any ideas on how we can get culling to work with our own LogarithmicNumericTickProvider. Is their another way to do this without using our own LogarithmicNumericTickProvider.

0 votes
10k views

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)?

0 votes
6k views

Hi,

I tried to implement a colormap view next to the heatmap chart. But couldn’t figure out how to set it up. It seems like it won’t work this way.

SciChartHeatmapColourMap colorMapView = new SciChartHeatmapColourMap(this);
colorMapView.findViewById(R.id.colorMapView);

I don’t know how Bindview works in the example code. Could you tell me how to link SciChartHeatmapColourMap to the view in layout xml?

Thanks.

  • Gang Xu asked 4 years ago
  • last active 4 years ago
0 votes
4k views

Hello
I want a realtime chart that start rendering from middle of the screen, not from start of the screen

0 votes
0 answers
5k views

I’ve made a candle stick chart.
It is displayed correctly on data of 1 to 23 minute in time series.
But for data above 23 minute in time series, it is not displayed correctly.
I attach a screen shot.
I’ve looked through all the data on chart with debugging, the data are all correct.
But the candles of the chart is not consistent to the data.
For the data below 23 minute in time series, it is all right.
I could not find the problem from my code.
The following is a part of my code for setting data on the chart.
private void setChartData(SmChartData chart_data) {
try {
if (chart_data == null)
return;

        chartType = chart_data.chartType;
        chartCycle = chart_data.cycle;


        final IRange visibleRange = surface.getXAxes().get(0).getVisibleRange();

        if (getSeriesType() == SmSeriesType.CandleStick || getSeriesType() == SmSeriesType.Ohlc) {
            if (ohlcDataSeries != null) {
                ohlcDataSeries.clear();
                ohlcDataSeries.append(chart_data.getDate(), chart_data.getOpen(), chart_data.getHigh(), chart_data.getLow(), chart_data.getClose());
                visibleRange.setMinMaxDouble(0, ohlcDataSeries.getCount() - 1);


            }
        } else {
            if (xyDataSeries != null) {
                xyDataSeries.clear();
                xyDataSeries.append(chart_data.getDate(), chart_data.getClose());
                visibleRange.setMinMaxDouble(0, xyDataSeries.getCount() - 1);
            }
        }

        // 주문의 위치를 다시 찾아 준다.
        refreshOrderAnnotation();
    } catch (Exception e) {
        String msg = e.getMessage();
    }
}

What is the problem?
Please let me know why It is not display its candles correctly for some time series values.
Thank you very much.

0 votes
11k views

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:

creenshot 2020-09-18 at 11.04.14.png

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)
0 votes
10k views

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
0 votes
0 answers
8k views

Hello! I want to create an AxisMarkerAnnotation but the padding doesn’t match the position of the text on the axis – I would like to align it and what is the way to do it? couldn’t find the right settings

0 votes
6k views

Hi,

I’m trying to colorize my Column Chart according to my Candle Chart (red / green).
I’ve tried to create a Palette provider, but I don’t know how to get the corresponding item from my Candle Data.

How can I do this?

0 votes
12k views

I would like to be able to have a Pie Chart go to the very edge of the layout it’s inside. Currently it appears as though there is some default built-in padding around Pie Charts that cannot be overridden. I’ve tried manually specifying padding and margins both programmatically (on the SciChartSurface object itself) and in the layout XML, but that default padding still exists.

I’ve included a screenshot of the sample app to show the padding I’m talking about (circled in red).

0 votes
3k views

Hello!

I want to draw an irregular polyhedron in 3D chart. And I know the coordinates for each vertex.
However, I couldn’t find the appropriate API.
please, need a API or a guide to help me…

best regards, Thank you

  • Mobile SW4 asked 3 years ago
  • last active 3 years ago
0 votes
3k views

How do I know when user edited the text on TextAnnoation so the app can save it?
How to do the same for https://www.scichart.com/questions/wpf/get-textannotation-text-after-user-editing for Android and iOS version of SciChart?

0 votes
11k views

When I open activity with chart on real devices chart area for a moment has black color and theh succesfuly displayed chart data.
On emulators I do not see thes behavior.
How can I fix black screen?

Showing 1 - 50 of 537 results