highcharts / highcharts-android

Android wrapper for Highcharts usage
Other
126 stars 30 forks source link

Footer Days Text in bottom #250

Closed teraiyamayurcontact closed 6 months ago

teraiyamayurcontact commented 1 year ago

Hello

i want to add footer in Highchart android native sdk .

3

soommy12 commented 1 year ago

@teraiyamayurcontact what do you mean by footer? Can you explain further?

teraiyamayurcontact commented 1 year ago

i want to add "Days" word in bottom of graph for native android sdk. Which is selected in above screenshot.

soommy12 commented 1 year ago

I can see the "Days" is already in the chart. You can use the HICredits class if you want to have it at the bottom. Check the example:

HICredits credits = new HICredits();
credits.setText("Days");
credits.setPosition(new HIAlignObject());
credits.getPosition().setAlign("center");
options.setCredits(credits);
teraiyamayurcontact commented 1 year ago

looks too small. Can we size bigger for text ?

credits.getStyle().setFontSize("20");

i have try above but its get crash.

soommy12 commented 1 year ago

First, you need to initialize the object. Like this:

credits.setStyle(new HICSSObject());
credits.getStyle().setFontSize("20");
teraiyamayurcontact commented 1 year ago

Hello,

its touching x-axis. can we do spacing between both of them. Please review attached screenshot.

10

soommy12 commented 1 year ago

No, sorry, spacing is not supported for HICredits. Although, you can use android native TextView under the chart to achieve the same.

teraiyamayurcontact commented 1 year ago

Textview i have added but not working

soommy12 commented 1 year ago

I'm sorry but I can't help you with android TextView since it's not within the scope of Highcharts but android itself. Although, what I can suggest is to make sure that when you put HIChartView and TextView in a single layout experiment with HIChartView width and height to avoid the chart overlapping your other android views (I strongly recommend using specified values in dp when it comes to the height of chart since _wrapcontent and _matchparent are not working correctly when the chart is one of the elements of more complicated android layout, example below)

        <com.highsoft.highcharts.core.HIChartView
            android:layout_width="match_parent"
            android:id="@+id/chartview"
            android:layout_height="500dp"/>

        <TextView
            android:id="@+id/texdt"
            android:text="Text"
            android:textSize="40sp"
            android:gravity="center"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
MikolajMichalczak commented 6 months ago

Closing due to inactivity. Please feel free to reopen the ticket if you have any further questions.