Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FarshidRoohi/LineGraph
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.2
Choose a base ref
...
head repository: FarshidRoohi/LineGraph
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Aug 19, 2021

  1. Update README.md

    FarshidRoohi committed Aug 19, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    eaf2161 View commit details
  2. Update README.md

    FarshidRoohi committed Aug 19, 2021
    Copy the full SHA
    079bc9c View commit details
Showing with 23 additions and 25 deletions.
  1. +23 −25 README.md
48 changes: 23 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
##Line Chart


[ ![Download](https://api.bintray.com/packages/farshidroohi/LineGraph/LineGraph/images/download.svg?version=0.1.3) ](https://bintray.com/farshidroohi/LineGraph/LineGraph/0.1.3/link)
![API](https://img.shields.io/badge/API-14%2B-blue.svg?style=flat)


@@ -13,21 +12,21 @@
###### Gradle :

```Gradle
implementation 'ir.farshid_roohi:linegraph:0.1.3'
implementation 'io.github.farshidroohi:lineGraph:1.0.2'
```
```xml
<ir.farshid_roohi.linegraph.LineChart
android:id="@+id/lineChart"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:chart_padding_bottom="35dp"
app:chart_padding_left="20dp"
app:chart_padding_right="20dp"
app:chart_padding_top="20dp"
app:chart_line_color="#32FFFFFF"
app:chart_bg_color="#FF2B4A83"
/>
<io.github.farshidroohi.LineChart
android:id="@+id/lineChart"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:chart_bg_color="#FF2B4A83"
app:chart_line_color="#32FFFFFF"
app:chart_line_size="4dp"
app:chart_padding_bottom="20dp"
app:chart_padding_left="20dp"
app:chart_padding_right="20dp"
app:chart_padding_top="20dp" />

```
```kotlin
@@ -41,16 +40,19 @@ class MainActivity : AppCompatActivity() {
val firstChartEntity = ChartEntity(Color.WHITE, graph1)
val secondChartEntity = ChartEntity(Color.YELLOW, graph2)

val list = ArrayList<ChartEntity>()
list.add(firstChartEntity)
list.add(secondChartEntity)
lineChart.legendArray = legendArr
val list = ArrayList<ChartEntity>().apply {
add(firstChartEntity)
add(secondChartEntity)
}

val lineChart = findViewById<LineChart>(R.id.lineChart)
lineChart.setLegend(legendArr)
lineChart.setList(list)
}

private val graph1 = floatArrayOf(113000f, 183000f, 188000f, 695000f, 324000f, 230000f, 188000f, 15000f, 126000f, 5000f, 33000f)
private val graph2 = floatArrayOf(0f, 245000f, 1011000f, 1000f, 0f, 0f, 47000f, 20000f, 12000f, 124400f, 160000f)
private val legendArr = arrayOf("05/21", "05/22", "05/23", "05/24", "05/25", "05/26", "05/27", "05/28", "05/29", "05/30", "05/31")
private val firstChartEntity = floatArrayOf(113000f, 183000f, 188000f, 695000f, 324000f, 230000f, 188000f, 15000f, 126000f, 5000f, 33000f)
private val secondChartEntity = floatArrayOf(0f, 245000f, 1011000f, 1000f, 0f, 0f, 47000f, 20000f, 12000f, 124400f, 160000f)
private val legendArr = listOf("05/21", "05/22", "05/23", "05/24", "05/25", "05/26", "05/27", "05/28", "05/29", "05/30", "05/31")

}

@@ -59,7 +61,3 @@ class MainActivity : AppCompatActivity() {

Goal :</br>
swipe chart line and show data chart tips

</br>
</br>
Thanks for the [HzGrapher](https://github.com/handstudio/HzGrapher)