的
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
.idea/
|
||||
.DS_Store
|
||||
@@ -0,0 +1,468 @@
|
||||
[<img src="https://cdn.anychart.com/images/logo-transparent-segoe.png?2" width="234px" alt="AnyChart - Robust JavaScript/HTML5 Chart library for any project">](https://www.anychart.com)
|
||||
|
||||
# AnyChart for Android
|
||||
[](https://jitpack.io/#AnyChart/AnyChart-Android) [](https://android-arsenal.com/api?level=19)
|
||||
|
||||
AnyChart Android Charts is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
|
||||
|
||||
Check out <a href="https://github.com/AnyChart/AnyChart-Android/wiki/Getting-started">getting started</a>.
|
||||
|
||||
## Installation
|
||||
|
||||
### Gradle
|
||||
Add this to the root build.gradle at the end of repositories (**WARNING:** Make sure you add this under **allprojects** not under buildscript):
|
||||
```groovy
|
||||
allprojects {
|
||||
repositories {
|
||||
...
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Add the dependency to the project build.gradle:
|
||||
```Groovy
|
||||
dependencies {
|
||||
implementation 'com.github.AnyChart:AnyChart-Android:1.1.2'
|
||||
}
|
||||
```
|
||||
|
||||
### JAR/AAR File
|
||||
Copy AAR file into the libs folder of the application project.
|
||||
|
||||
If you are using **Android Studio**:
|
||||
1. Right click on a project and choose "Open Module Settings".
|
||||
2. Click the plus button in the top left to add a new module.
|
||||
3. Choose "Import .JAR or .AAR Package".
|
||||
4. Find the AAR file.
|
||||
5. In the app's module click on the dependencies tab and add the new module as a dependency.
|
||||
|
||||
## Chart Types
|
||||
AnyChart product family includes scores of chart types and we're constantly adding new ones.
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Pie Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/piechart.png" alt="Pie Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/PieChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Column Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/columnchart.png" alt="Column Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/ColumnChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Line Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/linechart.png" alt="Line Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/LineChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Venn Diagram</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/venndiagram.png" alt="Venn Diagram - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/VennDiagramActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Radar Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/radarchart.png" alt="Radar Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/RadarChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Tag Cloud</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/tagcloud.png" alt="Tag Cloud - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/TagCloudActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<h3 align="center">Heat Map Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/heatmapchart.png" alt="Heat Map Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/HeatMapChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Waterfall Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/waterfallchart.png" alt="Waterfall Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/WaterfallChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Tree Map Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/treemapchart.png" alt="Tree Map Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/TreeMapChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Scatter Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/scatterchart.png" alt="Scatter Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/ScatterChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<h3 align="center">Resource Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/resourcechart.png" alt="Resource Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/ResourceChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Range Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/rangechart.png" alt="Range Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/RangeChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Vertical Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/verticalchart.png" alt="Vertical Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/RadarChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Funnel Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/funnelchart.png" alt="Funnel Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/FunnelChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<h3 align="center">Pert Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/pertchart.png" alt="Pert Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/PertChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Polar Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/polarchart.png" alt="Polar Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/PolarChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Pyramid Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/pyramidchart.png" alt="Pyramid Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/PyramidChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Bubble Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/bubblechart.png" alt="Bubble Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/BubbleChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Area Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/areachart.png" alt="Area Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/AreaChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Bar Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/barchart.png" alt="Bar Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/BarChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Box Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/boxchart.png" alt="Box Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/BoxChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Mosaic Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/mosaicchart.png" alt="Mosaic Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/MosaicChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Mekko Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/mekkochart.png" alt="Mekko Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/MekkoChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">3D Bar Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/bar3dchart.png" alt="3D Bar Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/Bar3DChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">3D Column Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/column3dchart.png" alt="3D Column Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/Column3DChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">3D Area Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/area3dchart.png" alt="3D Area Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/Area3DChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Circular Gauge</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/circulargauge.png" alt="Circular Gauge">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/CircularGaugeActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Pareto Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/paretochart.png" alt="Pareto Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/ParetoChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Combined Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/combinedchart.png" alt="Combined Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/CombinedChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Quadrant Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/quadrantchart.png" alt="Quadrant Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/QuadrantChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Hilo Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/hilochart.png" alt="Hilo Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/HiloChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">OHLC Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/ohlcchart.png" alt="OHLC Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/OHLCChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Bubble Map</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/bubblemap.png" alt="Bubble Map - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/BubbleMapActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Choropleth Map</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/choroplethmap.png" alt="Choropleth Map - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/ChoroplethMapActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Point Map</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/pointmap.png" alt="Point Map - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/PointMapActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Connector Map</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/connectormap.png" alt="Connector Map - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/ConnectorMapActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Sunburst Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/sunburstchart.png" alt="Sunburst Chart - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/SunburstChartActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Thermometer</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/thermometer.png" alt="Thermometer - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/ThermometerActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Linear Color Scale</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/linearcolorscale.png" alt="Linear Color Scale - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/LinearColorScaleActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%">
|
||||
<h3 align="center">Wind Speed Chart</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/windspeed.png" alt="Wind Speed - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/WindSpeedActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
<td width="33%">
|
||||
<h3 align="center">Wind Direction</h3>
|
||||
<hr>
|
||||
<img src="https://github.com/AnyChart/AnyChart-Android/blob/master/img/winddirection.png" alt="Wind Direction - AnyChart">
|
||||
<sup>
|
||||
<a href="https://play.google.com/store/apps/details?id=com.anychart.anychart">Sample app</a> /
|
||||
<a href="https://github.com/AnyChart/AnyChart-Android/blob/master/sample/src/main/java/com/anychart/sample/charts/WindDirectionActivity.java">Code Snippet</a>
|
||||
</sup>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## Contacts
|
||||
* Web: [www.anychart.com](https://www.anychart.com)
|
||||
* Email: [contact@anychart.com](mailto:contact@anychart.com)
|
||||
* Twitter: [anychart](https://twitter.com/anychart)
|
||||
* Facebook: [AnyCharts](https://www.facebook.com/AnyCharts)
|
||||
* LinkedIn: [anychart](https://www.linkedin.com/company/anychart)
|
||||
|
||||
## Links
|
||||
* [AnyChart Website](https://www.anychart.com)
|
||||
* [Download AnyChart](https://www.anychart.com/download/)
|
||||
* [AnyChart Licensing](https://www.anychart.com/buy/)
|
||||
* [AnyChart Support](https://www.anychart.com/support/)
|
||||
* [Report Issues](https://github.com/AnyChart/anychart/issues)
|
||||
* [AnyChart Playground](https://playground.anychart.com)
|
||||
* [AnyChart Documentation](https://docs.anychart.com)
|
||||
* [AnyChart API Reference](https://api.anychart.com)
|
||||
* [AnyChart Sample Solutions](https://www.anychart.com/solutions/)
|
||||
* [AnyChart Integrations](https://www.anychart.com/integrations/)
|
||||
|
||||
## License
|
||||
[© AnyChart.com - JavaScript charts](https://www.anychart.com). All rights reserved.
|
||||
<img src="https://ga-beacon.appspot.com/UA-228820-4/Wrappers/Android?pixel&useReferer">
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
$1/platform-tools/adb wait-for-device
|
||||
|
||||
A=$($1/platform-tools/adb shell getprop sys.boot_completed | tr -d '\r')
|
||||
|
||||
while [ "$A" != "1" ]; do
|
||||
sleep 2
|
||||
A=$($1/platform-tools/adb shell getprop sys.boot_completed | tr -d '\r')
|
||||
echo "Waiting for emulator to start"
|
||||
done
|
||||
@@ -0,0 +1 @@
|
||||
/build
|
||||
@@ -0,0 +1,29 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 32
|
||||
buildToolsVersion "32.0.0"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 32
|
||||
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in /home/arseny/Android/Sdk/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.anychart.anychart;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumentation test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
|
||||
assertEquals("com.anychart.anychart.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.anychart">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true">
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,29 @@
|
||||
package com.anychart;
|
||||
|
||||
public class APIlib {
|
||||
|
||||
private AnyChartView anyChartView;
|
||||
|
||||
private static volatile APIlib instance;
|
||||
|
||||
public static APIlib getInstance() {
|
||||
APIlib localInstance = instance;
|
||||
if (localInstance == null) {
|
||||
synchronized (APIlib.class) {
|
||||
localInstance = instance;
|
||||
if (localInstance == null) {
|
||||
instance = localInstance = new APIlib();
|
||||
}
|
||||
}
|
||||
}
|
||||
return localInstance;
|
||||
}
|
||||
|
||||
public void setActiveAnyChartView(AnyChartView anyChartView) {
|
||||
this.anyChartView = anyChartView;
|
||||
}
|
||||
|
||||
public void addJSLine(String jsLine) {
|
||||
anyChartView.getJsListener().onJsLineAdd(jsLine);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
package com.anychart;
|
||||
|
||||
public class AnyChart {
|
||||
|
||||
public static com.anychart.charts.Cartesian area() {
|
||||
return new com.anychart.charts.Cartesian("anychart.area()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian3d area3d() {
|
||||
return new com.anychart.charts.Cartesian3d("anychart.area3d()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian bar() {
|
||||
return new com.anychart.charts.Cartesian("anychart.bar()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian3d bar3d() {
|
||||
return new com.anychart.charts.Cartesian3d("anychart.bar3d()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Mekko barmekko() {
|
||||
return new com.anychart.charts.Mekko("anychart.barmekko()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian box() {
|
||||
return new com.anychart.charts.Cartesian("anychart.box()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Scatter bubble() {
|
||||
return new com.anychart.charts.Scatter("anychart.bubble()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Map bubbleMap() {
|
||||
return new com.anychart.charts.Map("anychart.bubbleMap()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Bullet bullet() {
|
||||
return new com.anychart.charts.Bullet("anychart.bullet()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian cartesian() {
|
||||
return new com.anychart.charts.Cartesian("anychart.cartesian()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian3d cartesian3d() {
|
||||
return new com.anychart.charts.Cartesian3d("anychart.cartesian3d()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Map choropleth() {
|
||||
return new com.anychart.charts.Map("anychart.choropleth()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.CircularGauge circularGauge() {
|
||||
return new com.anychart.charts.CircularGauge("anychart.circularGauge()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian column() {
|
||||
return new com.anychart.charts.Cartesian("anychart.column()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian3d column3d() {
|
||||
return new com.anychart.charts.Cartesian3d("anychart.column3d()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Map connector() {
|
||||
return new com.anychart.charts.Map("anychart.connector()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian financial() {
|
||||
return new com.anychart.charts.Cartesian("anychart.financial()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Funnel funnel() {
|
||||
return new com.anychart.charts.Funnel("anychart.funnel()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Gantt ganttProject() {
|
||||
return new com.anychart.charts.Gantt("anychart.ganttProject()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Gantt ganttResource() {
|
||||
return new com.anychart.charts.Gantt("anychart.ganttResource()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.HeatMap heatMap() {
|
||||
return new com.anychart.charts.HeatMap("anychart.heatMap()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian hilo() {
|
||||
return new com.anychart.charts.Cartesian("anychart.hilo()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian line() {
|
||||
return new com.anychart.charts.Cartesian("anychart.line()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian3d line3d() {
|
||||
return new com.anychart.charts.Cartesian3d("anychart.line3d()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Map map() {
|
||||
return new com.anychart.charts.Map("anychart.map()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Scatter marker() {
|
||||
return new com.anychart.charts.Scatter("anychart.marker()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Map markerMap() {
|
||||
return new com.anychart.charts.Map("anychart.markerMap()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Mekko mekko() {
|
||||
return new com.anychart.charts.Mekko("anychart.mekko()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Mekko mosaic() {
|
||||
return new com.anychart.charts.Mekko("anychart.mosaic()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Pareto pareto() {
|
||||
return new com.anychart.charts.Pareto("anychart.pareto()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Pert pert() {
|
||||
return new com.anychart.charts.Pert("anychart.pert()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Pie pie() {
|
||||
return new com.anychart.charts.Pie("anychart.pie()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Pie pie3d() {
|
||||
return new com.anychart.charts.Pie("anychart.pie3d()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Polar polar() {
|
||||
return new com.anychart.charts.Polar("anychart.polar()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Pyramid pyramid() {
|
||||
return new com.anychart.charts.Pyramid("anychart.pyramid()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Scatter quadrant() {
|
||||
return new com.anychart.charts.Scatter("anychart.quadrant()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Radar radar() {
|
||||
return new com.anychart.charts.Radar("anychart.radar()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Resource resource() {
|
||||
return new com.anychart.charts.Resource("anychart.resource()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Sankey sankey() {
|
||||
return new com.anychart.charts.Sankey("anychart.sankey()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Scatter scatter() {
|
||||
return new com.anychart.charts.Scatter("anychart.scatter()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Map seatMap() {
|
||||
return new com.anychart.charts.Map("anychart.seatMap()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Sparkline sparkline() {
|
||||
return new com.anychart.charts.Sparkline("anychart.sparkline()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Stock stock() {
|
||||
return new com.anychart.charts.Stock("anychart.stock()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Sunburst sunburst() {
|
||||
return new com.anychart.charts.Sunburst("anychart.sunburst()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.TagCloud tagCloud() {
|
||||
return new com.anychart.charts.TagCloud("anychart.tagCloud()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.TreeMap treeMap() {
|
||||
return new com.anychart.charts.TreeMap("anychart.treeMap()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Venn venn() {
|
||||
return new com.anychart.charts.Venn("anychart.venn()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian vertical() {
|
||||
return new com.anychart.charts.Cartesian("anychart.vertical()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian verticalArea() {
|
||||
return new com.anychart.charts.Cartesian("anychart.verticalArea()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Cartesian verticalLine() {
|
||||
return new com.anychart.charts.Cartesian("anychart.verticalLine()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.Waterfall waterfall() {
|
||||
return new com.anychart.charts.Waterfall("anychart.waterfall()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.CircularGauge circular() {
|
||||
return new com.anychart.charts.CircularGauge("anychart.gauges.circular()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.LinearGauge led() {
|
||||
return new com.anychart.charts.LinearGauge("anychart.gauges.led()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.LinearGauge linear() {
|
||||
return new com.anychart.charts.LinearGauge("anychart.gauges.linear()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.LinearGauge tank() {
|
||||
return new com.anychart.charts.LinearGauge("anychart.gauges.tank()");
|
||||
}
|
||||
|
||||
public static com.anychart.charts.LinearGauge thermometer() {
|
||||
return new com.anychart.charts.LinearGauge("anychart.gauges.thermometer()");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.anychart;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class AnyChartFormat {
|
||||
|
||||
public static void date(String date, int timeZone, String locale) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, "anychart.format.date(%s, %s, %s);", date, timeZone, locale));
|
||||
}
|
||||
|
||||
public static void dateTime(String date, String format, int timeZone, String locale) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, "anychart.format.dateTime(%s, %s, %s, %s);", date, format, timeZone, locale));
|
||||
}
|
||||
|
||||
public static void outputDateFormat(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, "anychart.format.outputDateFormat(%s);", value));
|
||||
}
|
||||
|
||||
public static void outputDateTimeFormat(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, "anychart.format.outputDateTimeFormat(%s);", value));
|
||||
}
|
||||
|
||||
public static void outputLocale(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, "anychart.format.outputLocale(%s);", value));
|
||||
}
|
||||
|
||||
public static void outputTimeFormat(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, "anychart.format.outputTimeFormat(%s);", value));
|
||||
}
|
||||
|
||||
public static void outputTimezone(Number value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, "anychart.format.outputTimezone(%s);", value));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,319 @@
|
||||
package com.anychart;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import androidx.annotation.Nullable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.webkit.ConsoleMessage;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.anychart.chart.common.listener.ListenersInterface;
|
||||
import com.anychart.core.Chart;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public final class AnyChartView extends FrameLayout {
|
||||
|
||||
public interface JsListener {
|
||||
void onJsLineAdd(String jsLine);
|
||||
}
|
||||
|
||||
public interface OnRenderedListener {
|
||||
void onRendered();
|
||||
}
|
||||
|
||||
private JsListener jsListener;
|
||||
private OnRenderedListener onRenderedListener;
|
||||
|
||||
private WebView webView;
|
||||
private Chart chart;
|
||||
|
||||
private boolean isRestored;
|
||||
private boolean isRendered;
|
||||
private boolean isDebug;
|
||||
|
||||
private StringBuilder scripts = new StringBuilder();
|
||||
private StringBuilder fonts = new StringBuilder();
|
||||
|
||||
protected StringBuilder js = new StringBuilder();
|
||||
|
||||
private String licenceKey = "";
|
||||
private View progressBar;
|
||||
private String backgroundColor;
|
||||
|
||||
public AnyChartView(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public AnyChartView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public AnyChartView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Parcelable onSaveInstanceState() {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelable("superState", super.onSaveInstanceState());
|
||||
bundle.putString("js", js.toString());
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestoreInstanceState(Parcelable state) {
|
||||
if (state instanceof Bundle) {
|
||||
Bundle bundle = (Bundle) state;
|
||||
js.append(bundle.getString("js"));
|
||||
state = bundle.getParcelable("superState");
|
||||
}
|
||||
isRestored = true;
|
||||
|
||||
super.onRestoreInstanceState(state);
|
||||
}
|
||||
|
||||
@SuppressLint({"SetJavaScriptEnabled", "AddJavascriptInterface"})
|
||||
private void init() {
|
||||
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
View view = inflater.inflate(R.layout.view_anychart, this, true);
|
||||
|
||||
APIlib.getInstance().setActiveAnyChartView(this);
|
||||
|
||||
if (progressBar != null)
|
||||
progressBar.setVisibility(VISIBLE);
|
||||
|
||||
webView = view.findViewById(R.id.web_view);
|
||||
WebSettings webSettings = webView.getSettings();
|
||||
webSettings.setLoadsImagesAutomatically(true);
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setLoadWithOverviewMode(true);
|
||||
webView.setLongClickable(true);
|
||||
webView.setOnLongClickListener(new OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
webView.setWebChromeClient(new WebChromeClient() {
|
||||
@Override
|
||||
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
|
||||
if (isDebug) Log.e("AnyChart", consoleMessage.message());
|
||||
webView.setEnabled(false);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
isRendered = false;
|
||||
JsObject.variableIndex = 0;
|
||||
setJsListener(new JsListener() {
|
||||
@Override
|
||||
public void onJsLineAdd(final String jsLine) {
|
||||
webView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isRestored) {
|
||||
return;
|
||||
}
|
||||
if (isRendered) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
webView.evaluateJavascript(jsLine, null);
|
||||
} else {
|
||||
webView.loadUrl("javascript:" + jsLine);
|
||||
}
|
||||
} else {
|
||||
js.append(jsLine);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
webView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
String resultJs = (isRestored)
|
||||
? js.toString()
|
||||
: js
|
||||
.append((getContext().getPackageName() != "com.anychart.anychart") ? androidCheck(licenceKey) : "")
|
||||
.append(chart.getJsBase()).append(".container(\"container\");")
|
||||
.toString();
|
||||
|
||||
webView.evaluateJavascript(
|
||||
"anychart.theme({\n" +
|
||||
" chart: {\n" +
|
||||
" credits: {\n" +
|
||||
" logoSrc: 'https://static.anychart.com/logo-for-android.png',\n" +
|
||||
" text: 'AnyChart Trial Version'\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
" });" +
|
||||
"anychart.onDocumentReady(function () {\n" +
|
||||
resultJs +
|
||||
"});",
|
||||
new ValueCallback<String>() {
|
||||
@Override
|
||||
public void onReceiveValue(String value) {
|
||||
if (onRenderedListener != null)
|
||||
onRenderedListener.onRendered();
|
||||
if (progressBar != null)
|
||||
progressBar.setVisibility(GONE);
|
||||
}
|
||||
});
|
||||
|
||||
isRestored = false;
|
||||
isRendered = true;
|
||||
}
|
||||
});
|
||||
webView.addJavascriptInterface(ListenersInterface.getInstance(), "android");
|
||||
}
|
||||
|
||||
private void loadHtml() {
|
||||
String htmlData = "<html>\n" +
|
||||
"<head>\n" +
|
||||
" <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n" +
|
||||
" <style type=\"text/css\">\n" +
|
||||
" html, body, #container {\n" +
|
||||
" width: 100%;\n" +
|
||||
" height: 100%;\n" +
|
||||
" margin: 0;\n" +
|
||||
" padding: 0;\n" +
|
||||
((backgroundColor != null) ? "background-color: " + backgroundColor + ";" : "") +
|
||||
" }\n" +
|
||||
fonts.toString() +
|
||||
" </style>\n" +
|
||||
"</head>\n" +
|
||||
"<body>\n" +
|
||||
"<script src=\"file:///android_asset/anychart-android.min.js\"></script>" +
|
||||
scripts.toString() +
|
||||
"<link rel=\"stylesheet\" href=\"file:///android_asset/anychart-ui.min.css\"/>\n" +
|
||||
"<div id=\"container\"></div>\n" +
|
||||
"</body>\n" +
|
||||
"</html>";
|
||||
|
||||
webView.loadDataWithBaseURL("https://www.google.com", htmlData, "text/html", "UTF-8", null);
|
||||
}
|
||||
|
||||
public void addScript(String url) {
|
||||
scripts.append("<script src=\"")
|
||||
.append(url)
|
||||
.append("\"></script>\n");
|
||||
}
|
||||
|
||||
public void addCss(String url) {
|
||||
scripts.append("<link rel=\"stylesheet\" href=\"")
|
||||
.append(url)
|
||||
.append("\"/>\n");
|
||||
}
|
||||
|
||||
public void addFont(String fontFamily, String url) {
|
||||
fonts.append("@font-face {\n")
|
||||
.append("font-family: ").append(fontFamily).append(";\n")
|
||||
.append("src: url(").append(url).append(");\n")
|
||||
.append("}\n");
|
||||
}
|
||||
|
||||
public void setLicenceKey(String key) {
|
||||
licenceKey = key;
|
||||
}
|
||||
|
||||
public void setZoomEnabled(Boolean value) {
|
||||
webView.getSettings().setBuiltInZoomControls(value);
|
||||
webView.getSettings().setDisplayZoomControls(!value);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
webView.loadUrl("about:blank");
|
||||
isRendered = false;
|
||||
if (progressBar != null) {
|
||||
progressBar.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void setChart(Chart chart) {
|
||||
isRestored = false;
|
||||
this.chart = chart;
|
||||
loadHtml();
|
||||
}
|
||||
|
||||
public void setProgressBar(View progressBar) {
|
||||
this.progressBar = progressBar;
|
||||
progressBar.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
public void setBackgroundColor(String color) {
|
||||
this.backgroundColor = color;
|
||||
webView.setBackgroundColor(Color.parseColor(color));
|
||||
}
|
||||
|
||||
public void setJsListener(JsListener listener) {
|
||||
this.jsListener = listener;
|
||||
}
|
||||
|
||||
public JsListener getJsListener() {
|
||||
return jsListener;
|
||||
}
|
||||
|
||||
public OnRenderedListener getOnRenderedListener() {
|
||||
return onRenderedListener;
|
||||
}
|
||||
|
||||
public void setOnRenderedListener(OnRenderedListener onRenderedListener) {
|
||||
this.onRenderedListener = onRenderedListener;
|
||||
}
|
||||
|
||||
public void setDebug(boolean value) {
|
||||
this.isDebug = value;
|
||||
}
|
||||
|
||||
private String md5(String s) {
|
||||
try {
|
||||
java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
|
||||
byte[] array = md.digest(s.getBytes(StandardCharsets.UTF_8));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < array.length; ++i) {
|
||||
sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1,3));
|
||||
}
|
||||
return sb.toString();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private String androidCheck(String l) {
|
||||
if (l == null || l.isEmpty() || md5(l) == "0df80e76aeca7dc40e01e876dca3542b") {
|
||||
return "var btoa = window.btoa(JSON.stringify({\n" +
|
||||
" chartType: '" + chart.getJsBase().replaceAll("\\d","") + "',\n" +
|
||||
" apkName: \"" + getContext().getPackageName() + "\"\n" +
|
||||
"}));" +
|
||||
chart.getJsBase() + ".credits({\n" +
|
||||
" logoSrc: 'https://static.anychart.com/logo-for-android.png?data=' + btoa,\n" +
|
||||
" text: 'AnyChart Trial Version'\n" +
|
||||
" });\n";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
package com.anychart;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class JsObject {
|
||||
|
||||
// public interface JsObjectInterface {
|
||||
// String getJsBase();
|
||||
// }
|
||||
|
||||
protected StringBuilder js = new StringBuilder();
|
||||
|
||||
public String getJsBase() {
|
||||
return js.toString();
|
||||
}
|
||||
|
||||
protected StringBuilder getJs() {
|
||||
return js;
|
||||
}
|
||||
|
||||
protected static int variableIndex = 0;
|
||||
|
||||
protected String jsBase;
|
||||
|
||||
// protected boolean isChain = false;
|
||||
|
||||
// protected static OnChange onChangeListener;
|
||||
|
||||
// protected static boolean isRendered = false;
|
||||
|
||||
protected JsObject() {
|
||||
|
||||
}
|
||||
|
||||
protected JsObject(String jsBase) {
|
||||
this.jsBase = jsBase;
|
||||
}
|
||||
|
||||
// interface OnChange {
|
||||
// void onChange(String jsChange);
|
||||
// }
|
||||
|
||||
// protected void setOnChangeListener(OnChange listener) {
|
||||
// onChangeListener = listener;
|
||||
//
|
||||
//// isRendered = true;
|
||||
// }
|
||||
|
||||
// protected String generateJsGetters() {
|
||||
// return "";
|
||||
// }
|
||||
|
||||
protected static String wrapQuotes(String value) {
|
||||
if (TextUtils.isEmpty(value)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (isJSONValid(value) || isFunction(value)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
StringBuilder result = new StringBuilder(value.length() + 2);
|
||||
result.append("\'").append(value).append("\'");
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
private static boolean isJSONValid(String json) {
|
||||
try {
|
||||
new JSONObject(json);
|
||||
} catch (JSONException ex1) {
|
||||
try {
|
||||
new JSONArray(json);
|
||||
} catch (JSONException ex2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean isFunction(String function) {
|
||||
return function.length() > 10 && function.trim().toLowerCase().substring(0, 8).equals("function");
|
||||
}
|
||||
|
||||
private static boolean isContainBracketOrBrace(String value) {
|
||||
return value.charAt(0) == '[' || value.charAt(0) == '{';
|
||||
}
|
||||
|
||||
protected static String arrayToStringWrapQuotes(String[] array) {
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
if (TextUtils.isDigitsOnly(array[i]) || isContainBracketOrBrace(array[i]))
|
||||
continue;
|
||||
array[i] = wrapQuotes(array[i]);
|
||||
}
|
||||
return Arrays.toString(array);
|
||||
}
|
||||
|
||||
protected static String arrayToString(JsObject[] jsObjects) {
|
||||
if (jsObjects == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
result.append("[");
|
||||
|
||||
for (int i = 0; i < jsObjects.length; i++) {
|
||||
result.append(jsObjects[i].getJsBase());
|
||||
if (i != jsObjects.length - 1) {
|
||||
result.append(", ");
|
||||
}
|
||||
}
|
||||
|
||||
result.append("]");
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
// protected static String arrayToString(JsObjectInterface[] jsObjects) {
|
||||
// if (jsObjects == null) {
|
||||
// return "";
|
||||
// }
|
||||
//
|
||||
// StringBuilder result = new StringBuilder();
|
||||
//
|
||||
// result.append("[");
|
||||
//
|
||||
// for (int i = 0; i < jsObjects.length; i++) {
|
||||
// result.append(jsObjects[i].getJsBase());
|
||||
// if (i != jsObjects.length - 1) {
|
||||
// result.append(", ");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// result.append("]");
|
||||
//
|
||||
// return result.toString();
|
||||
// }
|
||||
|
||||
protected static String arrayToString(Object[] jsObjects) {
|
||||
if (jsObjects == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
result.append("[");
|
||||
|
||||
for (int i = 0; i < jsObjects.length; i++) {
|
||||
Method method;
|
||||
try {
|
||||
method = jsObjects[i].getClass().getMethod("generateJs");
|
||||
result.append((String) method.invoke(jsObjects[i]));
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (i != jsObjects.length - 1) {
|
||||
result.append(", ");
|
||||
}
|
||||
}
|
||||
|
||||
result.append("]");
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
protected static String arrayToString(List<DataEntry> data) {
|
||||
if (data == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder resultData = new StringBuilder();
|
||||
resultData.append("[");
|
||||
for (DataEntry dataEntry : data) {
|
||||
resultData.append(dataEntry.generateJs()).append(", ");
|
||||
}
|
||||
resultData.setLength(resultData.length() - 1);
|
||||
resultData.append("]");
|
||||
|
||||
return resultData.toString();
|
||||
}
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
public class BoxDataEntry extends DataEntry {
|
||||
|
||||
public BoxDataEntry(String x, Integer low, Integer q1, Integer median, Integer q3, Integer high) {
|
||||
setValue("x", x);
|
||||
setValue("low", low);
|
||||
setValue("q1", q1);
|
||||
setValue("median", median);
|
||||
setValue("q3", q3);
|
||||
setValue("high", high);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
public class BubbleDataEntry extends DataEntry {
|
||||
|
||||
public BubbleDataEntry(String x, Integer value, Integer size) {
|
||||
setValue("x", x);
|
||||
setValue("value", value);
|
||||
setValue("size", size);
|
||||
}
|
||||
|
||||
public BubbleDataEntry(String x, Double value, Double size) {
|
||||
setValue("x", x);
|
||||
setValue("value", value);
|
||||
setValue("size", size);
|
||||
}
|
||||
|
||||
public BubbleDataEntry(Integer x, Integer value, Integer size) {
|
||||
setValue("x", x);
|
||||
setValue("value", value);
|
||||
setValue("size", size);
|
||||
}
|
||||
|
||||
public BubbleDataEntry(Double x, Double value, Double size) {
|
||||
setValue("x", x);
|
||||
setValue("value", value);
|
||||
setValue("size", size);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
public class CategoryValueDataEntry extends DataEntry {
|
||||
|
||||
public CategoryValueDataEntry(String x, String category, Integer value) {
|
||||
setValue("x", x);
|
||||
setValue("value", value);
|
||||
setValue("category", category);
|
||||
}
|
||||
|
||||
public CategoryValueDataEntry(String x, String category, Double value) {
|
||||
setValue("x", x);
|
||||
setValue("value", value);
|
||||
setValue("category", category);
|
||||
}
|
||||
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class DataEntry {
|
||||
|
||||
private Map<String, Object> hashMap = new HashMap<>();
|
||||
|
||||
public void setValue(String key, String value) {
|
||||
hashMap.put(key, value);
|
||||
}
|
||||
|
||||
public void setValue(String key, String[] values) {
|
||||
hashMap.put(key, values);
|
||||
}
|
||||
|
||||
public void setValue(String key, Number[] values) {
|
||||
hashMap.put(key, values);
|
||||
}
|
||||
|
||||
public void setValue(String key, Number value) {
|
||||
hashMap.put(key, (value != null) ? value.toString() : null);
|
||||
}
|
||||
|
||||
public void setValue(String key, Boolean value) {
|
||||
hashMap.put(key, value);
|
||||
}
|
||||
|
||||
public void setValue(String key, DataEntry value) {
|
||||
hashMap.put(key, value);
|
||||
}
|
||||
|
||||
public void setValue(String key, DataEntry[] values) {
|
||||
hashMap.put(key, values);
|
||||
}
|
||||
|
||||
public Object getValue(String key) {
|
||||
return hashMap.get(key);
|
||||
}
|
||||
|
||||
public Set<String> keySet() {
|
||||
return hashMap.keySet();
|
||||
}
|
||||
|
||||
public String generateJs() {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append("{");
|
||||
for (String key : hashMap.keySet()) {
|
||||
Object value = hashMap.get(key);
|
||||
|
||||
if (value == null) {
|
||||
js.append(String.format(Locale.US, "%s: %s,", key, "null"));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (value instanceof DataEntry) {
|
||||
js.append(String.format(Locale.US, "%s: %s,", key, ((DataEntry) value).generateJs()));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (value instanceof DataEntry[]) {
|
||||
js.append(String.format(Locale.US, "%s: %s,", key, toString((DataEntry[]) value)));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (value.getClass().isArray()) {
|
||||
String sValue;
|
||||
if (value instanceof Number[]) {
|
||||
sValue = toString((Number[]) value);
|
||||
} else {
|
||||
sValue = toString((String[]) value);
|
||||
}
|
||||
js.append(String.format(Locale.US, "%s: %s,", key, sValue));
|
||||
} else {
|
||||
if (value instanceof Number || value instanceof Boolean) {
|
||||
js.append(String.format(Locale.US, "%s: %s,", key, value));
|
||||
} else {
|
||||
js.append(String.format(Locale.US, "%s: '%s',", key, value));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hashMap.size() > 0)
|
||||
js.setLength(js.length() - 1);
|
||||
js.append("}");
|
||||
|
||||
return js.toString();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private String toString(String[] array) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append("[");
|
||||
for (String item : array) {
|
||||
result.append("\'").append(item).append("\',");
|
||||
}
|
||||
if (array.length > 0)
|
||||
result.setLength(result.length() - 1);
|
||||
result.append("]");
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private String toString(Number[] array) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append("[");
|
||||
for (Number item : array) {
|
||||
result.append(item).append(",");
|
||||
}
|
||||
if (array.length > 0)
|
||||
result.setLength(result.length() - 1);
|
||||
result.append("]");
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private String toString(DataEntry[] array) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append("[");
|
||||
for (DataEntry item : array) {
|
||||
result.append(item.generateJs()).append(",");
|
||||
}
|
||||
if (array.length > 0)
|
||||
result.setLength(result.length() - 1);
|
||||
result.append("]");
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
public class HeatDataEntry extends DataEntry {
|
||||
|
||||
public HeatDataEntry(String x, String y, Integer heat) {
|
||||
setValue("x", x);
|
||||
setValue("y", y);
|
||||
setValue("heat", heat);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
public class HighLowDataEntry extends DataEntry {
|
||||
|
||||
public HighLowDataEntry(String x, Number high, Number low) {
|
||||
setValue("x", x);
|
||||
setValue("high", high);
|
||||
setValue("low", low);
|
||||
}
|
||||
|
||||
public HighLowDataEntry(Number x, Number high, Number low) {
|
||||
setValue("x", x);
|
||||
setValue("high", high);
|
||||
setValue("low", low);
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
public class NameValueDataEntry extends DataEntry {
|
||||
|
||||
public NameValueDataEntry(String x, String name, Integer value) {
|
||||
setValue("x", x);
|
||||
setValue("name", name);
|
||||
setValue("value", value);
|
||||
}
|
||||
|
||||
public NameValueDataEntry(String x, String name, Double value) {
|
||||
setValue("x", x);
|
||||
setValue("name", name);
|
||||
setValue("value", value);
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
public class PertDataEntry extends DataEntry {
|
||||
|
||||
public PertDataEntry(String id, String name, String fullName) {
|
||||
setValue("id", id);
|
||||
setValue("name", name);
|
||||
setValue("fullName", fullName);
|
||||
}
|
||||
|
||||
public PertDataEntry(String id, String name, String fullName, String[] dependsOn) {
|
||||
setValue("id", id);
|
||||
setValue("name", name);
|
||||
setValue("fullName", fullName);
|
||||
setValue("dependsOn", dependsOn);
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
import com.anychart.data.View;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class SingleValueDataSet extends View {
|
||||
|
||||
private StringBuilder js = new StringBuilder();
|
||||
|
||||
private List<Object> values = new ArrayList<>();
|
||||
|
||||
public SingleValueDataSet(Object[] values) {
|
||||
this.values = Arrays.asList(values);
|
||||
}
|
||||
|
||||
public SingleValueDataSet(List<Object> values) {
|
||||
this.values.addAll(values);
|
||||
}
|
||||
|
||||
public void addValue(Object value) {
|
||||
values.add(value);
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return values.isEmpty();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
values.clear();
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
js.append("[");
|
||||
for (Object singleValue : values) {
|
||||
js.append(singleValue).append(",");
|
||||
}
|
||||
js.setLength(js.length() - 1);
|
||||
js.append("]");
|
||||
|
||||
return js.toString();
|
||||
}
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
public class TreeDataEntry extends DataEntry {
|
||||
|
||||
public TreeDataEntry(String id, String parent) {
|
||||
setValue("id", id);
|
||||
setValue("parent", parent);
|
||||
}
|
||||
|
||||
public TreeDataEntry(Integer id, String parent) {
|
||||
setValue("id", id);
|
||||
setValue("parent", parent);
|
||||
}
|
||||
|
||||
public TreeDataEntry(String id, Integer parent) {
|
||||
setValue("id", id);
|
||||
setValue("parent", parent);
|
||||
}
|
||||
|
||||
public TreeDataEntry(Integer id, Integer parent) {
|
||||
setValue("id", id);
|
||||
setValue("parent", parent);
|
||||
}
|
||||
|
||||
public TreeDataEntry(String id, String parent, Integer value) {
|
||||
setValue("id", id);
|
||||
setValue("parent", parent);
|
||||
setValue("value", value);
|
||||
}
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.anychart.chart.common.dataentry;
|
||||
|
||||
public class ValueDataEntry extends DataEntry {
|
||||
|
||||
public ValueDataEntry(String x, Number value) {
|
||||
setValue("x", x);
|
||||
setValue("value", value);
|
||||
}
|
||||
|
||||
public ValueDataEntry(Number x, Number value) {
|
||||
setValue("x", x);
|
||||
setValue("value", value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.anychart.chart.common.listener;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class Event {
|
||||
|
||||
private Map<String, String> data;
|
||||
|
||||
Event(Map<String, String> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Map<String, String> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.anychart.chart.common.listener;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.webkit.JavascriptInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ListenersInterface {
|
||||
|
||||
private static volatile ListenersInterface instance = null;
|
||||
|
||||
private ListenersInterface() {}
|
||||
|
||||
public static ListenersInterface getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized(ListenersInterface.class) {
|
||||
if (instance == null) {
|
||||
instance = new ListenersInterface();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private OnClickListener listener;
|
||||
|
||||
private interface ClickListener {
|
||||
void onClick(Event event);
|
||||
}
|
||||
|
||||
public abstract static class OnClickListener implements ClickListener {
|
||||
|
||||
private String[] fields;
|
||||
|
||||
public OnClickListener() {
|
||||
|
||||
}
|
||||
|
||||
public OnClickListener(String[] fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
public String[] getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setOnClickListener(OnClickListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void onClick(String sData) {
|
||||
if (TextUtils.isEmpty(sData)) {
|
||||
listener.onClick(new Event(null));
|
||||
} else {
|
||||
Map<String, String> data = new HashMap<>();
|
||||
|
||||
for (String item : sData.split(",")) {
|
||||
String[] itemSplit = item.split(":");
|
||||
String field = itemSplit[0];
|
||||
String value = itemSplit[1];
|
||||
data.put(field, value);
|
||||
}
|
||||
|
||||
listener.onClick(new Event(data));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
package com.anychart.charts.resource;
|
||||
|
||||
import com.anychart.JsObject;
|
||||
|
||||
import com.anychart.core.gantt.timelineheader.LevelWrapper;
|
||||
import com.anychart.enums.Interval;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
|
||||
// typedef
|
||||
/**
|
||||
* Type definition for zoom level.
|
||||
*/
|
||||
public class ZoomLevel extends JsObject {
|
||||
|
||||
|
||||
public ZoomLevel(Number count, String id, com.anychart.core.gantt.timelineheader.LevelWrapper[] levels, Interval unit, Number unitPixSize) {
|
||||
js.append(String.format(Locale.US, "{count:%s, id: %s, levels: %s, unit: %s, unitPixSize: %s, } ", count, wrapQuotes(id), arrayToString(levels), (unit != null) ? unit.getJsBase() : null, unitPixSize));
|
||||
}
|
||||
public ZoomLevel(Number count, String id, com.anychart.core.gantt.timelineheader.LevelWrapper[] levels, String unit, Number unitPixSize) {
|
||||
js.append(String.format(Locale.US, "{count:%s, id: %s, levels: %s, unit: %s, unitPixSize: %s, } ", count, wrapQuotes(id), arrayToString(levels), wrapQuotes(unit), unitPixSize));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJsBase() {
|
||||
return js.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.anychart.charts.stock;
|
||||
|
||||
import com.anychart.JsObject;
|
||||
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
|
||||
// typedef
|
||||
/**
|
||||
* Type definition for the selected range.
|
||||
*/
|
||||
public class SelectedRange extends JsObject {
|
||||
|
||||
|
||||
public SelectedRange(Number firstSelected, Number firstVisible, Number lastSelected, Number lastVisible) {
|
||||
js.append(String.format(Locale.US, "{firstSelected:%s, firstVisible: %s, lastSelected: %s, lastVisible: %s, } ", firstSelected, firstVisible, lastSelected, lastVisible));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJsBase() {
|
||||
return js.toString();
|
||||
}
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.anychart.charts.sunburst;
|
||||
|
||||
import com.anychart.JsObject;
|
||||
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
|
||||
// typedef
|
||||
/**
|
||||
* Type definition for the statistics fields name.
|
||||
*/
|
||||
public class StatsFieldsName extends JsObject {
|
||||
|
||||
|
||||
public StatsFieldsName(Number depth, String[] level) {
|
||||
js.append(String.format(Locale.US, "{depth:%s, level: %s, } ", depth, arrayToStringWrapQuotes(level)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJsBase() {
|
||||
return js.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Class implements all the work with consistency states.
|
||||
invalidate() and markConsistent() are used to change states.
|
||||
isConsistent() and hasInvalidationState() are used to check states.
|
||||
*/
|
||||
public class Base extends JsObject {
|
||||
|
||||
protected Base() {
|
||||
|
||||
}
|
||||
|
||||
public static Base instantiate() {
|
||||
return new Base("new anychart.core.base()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Base(String jsChart) {
|
||||
jsBase = "base" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.SeriesPoint;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Point representing bubble points that belongs to cartesian or scatter chart.
|
||||
*/
|
||||
public class BubblePoint extends SeriesPoint {
|
||||
|
||||
protected BubblePoint() {
|
||||
|
||||
}
|
||||
|
||||
public static BubblePoint instantiate() {
|
||||
return new BubblePoint("new anychart.core.bubblePoint()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public BubblePoint(String jsChart) {
|
||||
jsBase = "bubblePoint" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the point with the given index exists in a dataset.
|
||||
*/
|
||||
public void exists() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".exists();");
|
||||
}
|
||||
/**
|
||||
* Fetches a field value from point data row by its name.
|
||||
*/
|
||||
public void get(String field) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".get(%s);", wrapQuotes(field)));
|
||||
}
|
||||
/**
|
||||
* Getter for the chart which current point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Getter for the point index in chart or series.
|
||||
*/
|
||||
public void getIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getIndex();");
|
||||
}
|
||||
/**
|
||||
* Getter for the bubble point radius.
|
||||
*/
|
||||
public void getPixelRadius() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getPixelRadius();");
|
||||
}
|
||||
/**
|
||||
* Getter for series which current point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase getSeries() {
|
||||
return new com.anychart.core.SeriesBase(jsBase + ".getSeries()");
|
||||
}
|
||||
/**
|
||||
* Returns stack value of the point.
|
||||
<b>Note</b>: Works only after chart.draw() is called.
|
||||
*/
|
||||
public void getStackValue() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getStackValue();");
|
||||
}
|
||||
/**
|
||||
* Returns stack zero of the point.
|
||||
<b>Note</b>: Works only after chart.draw() is called.
|
||||
*/
|
||||
public void getStackZero() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getStackZero();");
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(com.anychart.enums.Statistics key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", (key != null) ? key.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the hover point state.
|
||||
*/
|
||||
public void hovered() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hovered();");
|
||||
}
|
||||
/**
|
||||
* Setter for the hover point state.
|
||||
*/
|
||||
public com.anychart.core.BubblePoint hovered(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the select series point state.
|
||||
*/
|
||||
public void selected() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".selected();");
|
||||
}
|
||||
/**
|
||||
* Setter for the select series point state.
|
||||
*/
|
||||
public com.anychart.core.BubblePoint selected(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Sets the field of the point data row to the specified value.
|
||||
*/
|
||||
public com.anychart.core.BubblePoint set(String field, String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".set(%s, %s);", wrapQuotes(field), wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,232 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.SeriesPoint;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Point representing choropleth points that belongs to map.
|
||||
*/
|
||||
public class ChoroplethPoint extends SeriesPoint {
|
||||
|
||||
protected ChoroplethPoint() {
|
||||
|
||||
}
|
||||
|
||||
public static ChoroplethPoint instantiate() {
|
||||
return new ChoroplethPoint("new anychart.core.choroplethPoint()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ChoroplethPoint(String jsChart) {
|
||||
jsBase = "choroplethPoint" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the point crs (coordinate system).
|
||||
*/
|
||||
public void crs() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".crs();");
|
||||
}
|
||||
/**
|
||||
* Changes crs (coordinate system) of the point.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Map#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.ChoroplethPoint crs(String crs) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".crs(%s);", wrapQuotes(crs)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Checks if the point with the given index exists in a dataset.
|
||||
*/
|
||||
public void exists() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".exists();");
|
||||
}
|
||||
/**
|
||||
* Fetches a field value from point data row by its name.
|
||||
*/
|
||||
public void get(String field) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".get(%s);", wrapQuotes(field)));
|
||||
}
|
||||
/**
|
||||
* Getter for the chart which current point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Getter for the point bounds.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Map#draw} is called.
|
||||
*/
|
||||
public com.anychart.math.Rect getFeatureBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getFeatureBounds()");
|
||||
}
|
||||
/**
|
||||
* Getter for the point properties.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Map#draw} is called.
|
||||
*/
|
||||
public void getFeatureProp() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getFeatureProp();");
|
||||
}
|
||||
/**
|
||||
* Getter for the point index in chart or series.
|
||||
*/
|
||||
public void getIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getIndex();");
|
||||
}
|
||||
/**
|
||||
* Getter for series which current point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase getSeries() {
|
||||
return new com.anychart.core.SeriesBase(jsBase + ".getSeries()");
|
||||
}
|
||||
/**
|
||||
* Returns stack value of the point.
|
||||
<b>Note</b>: Works only after chart.draw() is called.
|
||||
*/
|
||||
public void getStackValue() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getStackValue();");
|
||||
}
|
||||
/**
|
||||
* Returns stack zero of the point.
|
||||
<b>Note</b>: Works only after chart.draw() is called.
|
||||
*/
|
||||
public void getStackZero() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getStackZero();");
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(com.anychart.enums.Statistics key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", (key != null) ? key.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the hover point state.
|
||||
*/
|
||||
public void hovered() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hovered();");
|
||||
}
|
||||
/**
|
||||
* Setter for the hover point state.
|
||||
*/
|
||||
public com.anychart.core.ChoroplethPoint hovered(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the X center of the point label.
|
||||
*/
|
||||
public void middleX() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".middleX();");
|
||||
}
|
||||
/**
|
||||
* Setter for the X center of the point label.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Map#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.ChoroplethPoint middleX(Number xCoord) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".middleX(%s);", xCoord));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Y center of the point label.
|
||||
*/
|
||||
public void middleY() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".middleY();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Y center of the point label.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Map#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.ChoroplethPoint middleY(Number yCoord) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".middleY(%s);", yCoord));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the scale of the point.
|
||||
*/
|
||||
public void scaleFactor() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".scaleFactor();");
|
||||
}
|
||||
/**
|
||||
* Scales point.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Map#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.ChoroplethPoint scaleFactor(Number scaleFactor) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scaleFactor(%s);", scaleFactor));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the select series point state.
|
||||
*/
|
||||
public void selected() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".selected();");
|
||||
}
|
||||
/**
|
||||
* Setter for the select series point state.
|
||||
*/
|
||||
public com.anychart.core.ChoroplethPoint selected(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Sets the field of the point data row to the specified value.
|
||||
*/
|
||||
public com.anychart.core.ChoroplethPoint set(String field, String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".set(%s, %s);", wrapQuotes(field), wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Moves point.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Map#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.ChoroplethPoint translate(Number dx, Number dy) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".translate(%s, %s);", dx, dy));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the point translation.
|
||||
*/
|
||||
public void translation() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".translation();");
|
||||
}
|
||||
/**
|
||||
* Setter for the point translation.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Map#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.ChoroplethPoint translation(Number dx, Number dy) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".translation(%s, %s);", dx, dy));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.Point;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Series-based chart point.
|
||||
*/
|
||||
public class MapPoint extends Point {
|
||||
|
||||
protected MapPoint() {
|
||||
|
||||
}
|
||||
|
||||
public static MapPoint instantiate() {
|
||||
return new MapPoint("new anychart.core.mapPoint()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public MapPoint(String jsChart) {
|
||||
jsBase = "mapPoint" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks the existence of the current point (by index) in dataset.
|
||||
*/
|
||||
public void exists() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".exists();");
|
||||
}
|
||||
/**
|
||||
* Fetches a field value from point data row by its name.
|
||||
*/
|
||||
public void get(String field) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".get(%s);", wrapQuotes(field)));
|
||||
}
|
||||
/**
|
||||
* Getter for the chart which current point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Returns current visible map on stage.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getCurrentChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getCurrentChart()");
|
||||
}
|
||||
/**
|
||||
* Returns point geo id.
|
||||
*/
|
||||
public void getId() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getId();");
|
||||
}
|
||||
/**
|
||||
* Getter for the point index in chart or series.
|
||||
*/
|
||||
public void getIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getIndex();");
|
||||
}
|
||||
/**
|
||||
* Returns point parent map chart.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getParentChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getParentChart()");
|
||||
}
|
||||
/**
|
||||
* Returns point geo properties.
|
||||
*/
|
||||
public void getProperties() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getProperties();");
|
||||
}
|
||||
/**
|
||||
* Getter for the hover point state.
|
||||
*/
|
||||
public void hovered() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hovered();");
|
||||
}
|
||||
/**
|
||||
* Setter for hover point state.
|
||||
*/
|
||||
public com.anychart.core.MapPoint hovered(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the select point state.
|
||||
*/
|
||||
public void selected() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".selected();");
|
||||
}
|
||||
/**
|
||||
* Setter for select point state.
|
||||
*/
|
||||
public com.anychart.core.MapPoint selected(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Sets the field of the point data row to the specified value.
|
||||
*/
|
||||
public com.anychart.core.MapPoint set(String field, String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".set(%s, %s);", wrapQuotes(field), wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(com.anychart.enums.Statistics key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", (key != null) ? key.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", wrapQuotes(key)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.Base;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Class with settings for "No data" feature.<br/>
|
||||
{docs:Working_with_Data/No_Data_Label} Learn more about "No data" feature {docs}
|
||||
*/
|
||||
public class NoDataSettings extends Base {
|
||||
|
||||
protected NoDataSettings() {
|
||||
|
||||
}
|
||||
|
||||
public static NoDataSettings instantiate() {
|
||||
return new NoDataSettings("new anychart.core.noDataSettings()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public NoDataSettings(String jsChart) {
|
||||
jsBase = "noDataSettings" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for no data label.
|
||||
*/
|
||||
public com.anychart.core.ui.Label label() {
|
||||
return new com.anychart.core.ui.Label(jsBase + ".label()");
|
||||
}
|
||||
/**
|
||||
* Setter for no data label.
|
||||
*/
|
||||
public com.anychart.core.NoDataSettings label(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".label(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for no data label.
|
||||
*/
|
||||
public com.anychart.core.NoDataSettings label(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".label(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.Point;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Point representing pie point.
|
||||
*/
|
||||
public class PiePoint extends Point {
|
||||
|
||||
protected PiePoint() {
|
||||
|
||||
}
|
||||
|
||||
public static PiePoint instantiate() {
|
||||
return new PiePoint("new anychart.core.piePoint()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public PiePoint(String jsChart) {
|
||||
jsBase = "piePoint" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks the existence of the current point (by index) in dataset.
|
||||
*/
|
||||
public void exists() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".exists();");
|
||||
}
|
||||
/**
|
||||
* Fetches a field value from point data row by its name.
|
||||
*/
|
||||
public void get(String field) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".get(%s);", wrapQuotes(field)));
|
||||
}
|
||||
/**
|
||||
* Getter for the chart which current point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Gets end angle of the point.
|
||||
<b>Note</b>: Works only after chart.draw() is called.
|
||||
*/
|
||||
public void getEndAngle() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getEndAngle();");
|
||||
}
|
||||
/**
|
||||
* Getter for the point index in chart or series.
|
||||
*/
|
||||
public void getIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getIndex();");
|
||||
}
|
||||
/**
|
||||
* Gets start angle of the point.
|
||||
<b>Note</b>: Works only after chart.draw() is called.
|
||||
*/
|
||||
public void getStartAngle() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getStartAngle();");
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(com.anychart.enums.Statistics key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", (key != null) ? key.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the hover point state.
|
||||
*/
|
||||
public void hovered() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hovered();");
|
||||
}
|
||||
/**
|
||||
* Setter for hover point state.
|
||||
*/
|
||||
public com.anychart.core.PiePoint hovered(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the select point state.
|
||||
*/
|
||||
public void selected() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".selected();");
|
||||
}
|
||||
/**
|
||||
* Setter for the select point state.
|
||||
*/
|
||||
public com.anychart.core.PiePoint selected(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Sets the field of the point data row to the specified value.
|
||||
*/
|
||||
public com.anychart.core.PiePoint set(String field, String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".set(%s, %s);", wrapQuotes(field), wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Class that wraps point of series/chart.
|
||||
*/
|
||||
public class Point extends JsObject {
|
||||
|
||||
protected Point() {
|
||||
|
||||
}
|
||||
|
||||
public static Point instantiate() {
|
||||
return new Point("new anychart.core.point()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Point(String jsChart) {
|
||||
jsBase = "point" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks the existence of the current point (by index) in dataset.
|
||||
*/
|
||||
public void exists() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".exists();");
|
||||
}
|
||||
/**
|
||||
* Fetches a field value from point data row by its name.
|
||||
*/
|
||||
public void get(String field) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".get(%s);", wrapQuotes(field)));
|
||||
}
|
||||
/**
|
||||
* Getter for the chart which current point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Getter for the point index in chart or series.
|
||||
*/
|
||||
public void getIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getIndex();");
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(com.anychart.enums.Statistics key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", (key != null) ? key.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the hover point state.
|
||||
*/
|
||||
public void hovered() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hovered();");
|
||||
}
|
||||
/**
|
||||
* Setter for hover point state.
|
||||
*/
|
||||
public com.anychart.core.Point hovered(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the select point state.
|
||||
*/
|
||||
public void selected() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".selected();");
|
||||
}
|
||||
/**
|
||||
* Setter for select point state.
|
||||
*/
|
||||
public com.anychart.core.Point selected(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Sets the field of the point data row to the specified value.
|
||||
*/
|
||||
public com.anychart.core.Point set(String field, String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".set(%s, %s);", wrapQuotes(field), wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,997 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBaseWithBounds;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Base class for all base series.<br/>
|
||||
Base class defines common methods, such as those for:
|
||||
<ul>
|
||||
<li>Binding series to a scale: <i>xScale, yScale</i></li>
|
||||
<li>Base color settings: <i>color</i></li>
|
||||
</ul>
|
||||
You can also obtain <i>getIterator, getResetIterator</i> iterators here.
|
||||
*/
|
||||
public class SeriesBase extends VisualBaseWithBounds {
|
||||
|
||||
protected SeriesBase() {
|
||||
|
||||
}
|
||||
|
||||
public static SeriesBase instantiate() {
|
||||
return new SeriesBase("new anychart.core.seriesBase()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public SeriesBase(String jsChart) {
|
||||
jsBase = "seriesBase" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for the accessibility setting.
|
||||
*/
|
||||
public com.anychart.core.utils.SeriesA11y a11y() {
|
||||
return new com.anychart.core.utils.SeriesA11y(jsBase + ".a11y()");
|
||||
}
|
||||
/**
|
||||
* Setter for the accessibility setting.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase a11y(Boolean value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".a11y(%s);", value));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the accessibility setting.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase a11y(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".a11y(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element bottom bound settings.
|
||||
*/
|
||||
public void bottom() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".bottom();");
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bottom(Number bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", bottom));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bottom(String bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", wrapQuotes(bottom)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.utils.Bounds bounds() {
|
||||
return new com.anychart.core.utils.Bounds(jsBase + ".bounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(com.anychart.utils.RectObj bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(com.anychart.core.utils.Bounds bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(Number x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(Number x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(Number x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(Number x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(Number x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(Number x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(Number x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(Number x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(String x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(String x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(String x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(String x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(String x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(String x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(String x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase bounds(String x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the series color.
|
||||
*/
|
||||
public void color() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".color();");
|
||||
}
|
||||
/**
|
||||
* Setter for the series color.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase color(String color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".color(%s);", wrapQuotes(color)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the color scale.
|
||||
*/
|
||||
public com.anychart.scales.LinearColor colorScale() {
|
||||
return new com.anychart.scales.LinearColor(jsBase + ".colorScale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the color scale.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase colorScale(com.anychart.scales.LinearColor settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".colorScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the color scale.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase colorScale(com.anychart.scales.OrdinalColor settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".colorScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the color scale.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase colorScale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".colorScale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the color scale.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase colorScale(com.anychart.enums.ScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".colorScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public com.anychart.data.View data(List<DataEntry> data) {
|
||||
return new com.anychart.data.View(String.format(Locale.US, jsBase + ".data(%s)", arrayToString(data)));
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns pixel bounds of the element due to parent bounds and self bounds settings.
|
||||
*/
|
||||
public com.anychart.math.Rect getPixelBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getPixelBounds()");
|
||||
}
|
||||
/**
|
||||
* Gets wrapped point by index.
|
||||
*/
|
||||
public com.anychart.core.SeriesPoint getPoint(Number index) {
|
||||
return new com.anychart.core.SeriesPoint(String.format(Locale.US, jsBase + ".getPoint(%s)", index));
|
||||
}
|
||||
/**
|
||||
* Gets the statistics value by key.
|
||||
*/
|
||||
public void getStat(com.anychart.enums.Statistics key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", (key != null) ? key.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Gets the statistics value by key.
|
||||
*/
|
||||
public void getStat(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for element height settings.
|
||||
*/
|
||||
public void height() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".height();");
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase height(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase height(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Hovers points.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase hover() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hover();");
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Hovers point by index.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase hover(Number index) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hover(%s);", index));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Hovers points by indexes.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase hover(Number[] indexes) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hover(%s);", Arrays.toString(indexes)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for hovered state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings hovered() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".hovered()");
|
||||
}
|
||||
/**
|
||||
* Setter for hovered state settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase hovered(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the series id.
|
||||
*/
|
||||
public void id() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".id();");
|
||||
}
|
||||
/**
|
||||
* Setter for the series id.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase id(String id) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".id(%s);", wrapQuotes(id)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the series id.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase id(Number id) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".id(%s);", id));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the series data labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory labels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".labels()");
|
||||
}
|
||||
/**
|
||||
* Setter for the series data labels.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase labels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the series data labels.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase labels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element left bound settings.
|
||||
*/
|
||||
public void left() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".left();");
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase left(Number left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", left));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase left(String left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", wrapQuotes(left)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for legend item settings for series.
|
||||
*/
|
||||
public com.anychart.core.utils.LegendItemSettings legendItem() {
|
||||
return new com.anychart.core.utils.LegendItemSettings(jsBase + ".legendItem()");
|
||||
}
|
||||
/**
|
||||
* Setter for legend item settings for series.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase legendItem(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".legendItem(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for series data markers.
|
||||
*/
|
||||
public com.anychart.core.ui.MarkersFactory markers() {
|
||||
return new com.anychart.core.ui.MarkersFactory(jsBase + ".markers()");
|
||||
}
|
||||
/**
|
||||
* Setter for series data markers.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase markers(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".markers(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for series data markers.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase markers(Boolean value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".markers(%s);", value));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum height.
|
||||
*/
|
||||
public void maxHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase maxHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase maxHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum width.
|
||||
*/
|
||||
public void maxWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase maxWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase maxWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for series meta data.
|
||||
*/
|
||||
public void meta(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".meta(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Setter for series meta data using object.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase meta(String object, String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".meta(%s, %s);", wrapQuotes(object), wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum height.
|
||||
*/
|
||||
public void minHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase minHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase minHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum width.
|
||||
*/
|
||||
public void minWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase minWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase minWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the series name.
|
||||
*/
|
||||
public void name() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".name();");
|
||||
}
|
||||
/**
|
||||
* Setter for the series name.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase name(String name) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".name(%s);", wrapQuotes(name)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for normal state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings normal() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".normal()");
|
||||
}
|
||||
/**
|
||||
* Setter for normal state settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase normal(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".normal(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for element right bound settings.
|
||||
*/
|
||||
public void right() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".right();");
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase right(Number right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", right));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase right(String right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", wrapQuotes(right)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Selects point by index.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase select(Number index) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".select(%s);", index));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Selects point by indexes.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase select(Number[] indexes) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".select(%s);", Arrays.toString(indexes)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for selected state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings selected() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".selected()");
|
||||
}
|
||||
/**
|
||||
* Setter for selected state settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase selected(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Gets the state of the series for selection mode.
|
||||
*/
|
||||
public void selectionMode() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".selectionMode();");
|
||||
}
|
||||
/**
|
||||
* Allows to select points of the series.
|
||||
To select multiple points, press 'ctrl' and click on them.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase selectionMode(com.anychart.enums.SelectionMode value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selectionMode(%s);", (value != null) ? value.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Allows to select points of the series.
|
||||
To select multiple points, press 'ctrl' and click on them.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase selectionMode(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selectionMode(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the series data tooltip.
|
||||
*/
|
||||
public com.anychart.core.ui.Tooltip tooltip() {
|
||||
return new com.anychart.core.ui.Tooltip(jsBase + ".tooltip()");
|
||||
}
|
||||
/**
|
||||
* Setter for the series data tooltip.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase tooltip(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".tooltip(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the series data tooltip.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase tooltip(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".tooltip(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element top bound settings.
|
||||
*/
|
||||
public void top() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".top();");
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase top(Number top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", top));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase top(String top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", wrapQuotes(top)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Removes hover from the series.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase unhover(Number indexOrIndexes) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unhover(%s);", indexOrIndexes));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Removes hover from the series.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase unhover(Number[] indexOrIndexes) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unhover(%s);", Arrays.toString(indexOrIndexes)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Deselects all selected points.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase unselect() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".unselect();");
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Deselects selected point by index.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase unselect(Number index) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unselect(%s);", index));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Deselects selected points by indexes.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase unselect(Number[] indexes) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unselect(%s);", Arrays.toString(indexes)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element width settings.
|
||||
*/
|
||||
public void width() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".width();");
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase width(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase width(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public com.anychart.data.View data(com.anychart.data.View data) {
|
||||
return new com.anychart.data.View(String.format(Locale.US, jsBase + ".data(%s)", (data != null) ? data.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public com.anychart.data.View data(List<DataEntry> data, com.anychart.enums.TreeFillingMethod fillMethod) {
|
||||
return new com.anychart.data.View(String.format(Locale.US, jsBase + ".data(%s, %s)", arrayToString(data), (fillMethod != null) ? fillMethod.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public com.anychart.data.View data(List<DataEntry> data, String fillMethod) {
|
||||
return new com.anychart.data.View(String.format(Locale.US, jsBase + ".data(%s, %s)", arrayToString(data), wrapQuotes(fillMethod)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.Point;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Point representing all points that belongs to series-based chart.
|
||||
*/
|
||||
public class SeriesPoint extends Point {
|
||||
|
||||
protected SeriesPoint() {
|
||||
|
||||
}
|
||||
|
||||
public static SeriesPoint instantiate() {
|
||||
return new SeriesPoint("new anychart.core.seriesPoint()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public SeriesPoint(String jsChart) {
|
||||
jsBase = "seriesPoint" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the point with the given index exists in a dataset.
|
||||
*/
|
||||
public void exists() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".exists();");
|
||||
}
|
||||
/**
|
||||
* Fetches a field value from point data row by its name.
|
||||
*/
|
||||
public void get(String field) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".get(%s);", wrapQuotes(field)));
|
||||
}
|
||||
/**
|
||||
* Getter for the chart which current point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Getter for the point index in chart or series.
|
||||
*/
|
||||
public void getIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getIndex();");
|
||||
}
|
||||
/**
|
||||
* Getter for series which current point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeriesBase getSeries() {
|
||||
return new com.anychart.core.SeriesBase(jsBase + ".getSeries()");
|
||||
}
|
||||
/**
|
||||
* Returns stack value of the point.
|
||||
<b>Note</b>: Works only after chart.draw() is called.
|
||||
*/
|
||||
public void getStackValue() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getStackValue();");
|
||||
}
|
||||
/**
|
||||
* Returns stack zero of the point.
|
||||
<b>Note</b>: Works only after chart.draw() is called.
|
||||
*/
|
||||
public void getStackZero() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getStackZero();");
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(com.anychart.enums.Statistics key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", (key != null) ? key.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the hover point state.
|
||||
*/
|
||||
public void hovered() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hovered();");
|
||||
}
|
||||
/**
|
||||
* Setter for the hover point state.
|
||||
*/
|
||||
public com.anychart.core.SeriesPoint hovered(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the select series point state.
|
||||
*/
|
||||
public void selected() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".selected();");
|
||||
}
|
||||
/**
|
||||
* Setter for the select series point state.
|
||||
*/
|
||||
public com.anychart.core.SeriesPoint selected(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Sets the field of the point data row to the specified value.
|
||||
*/
|
||||
public com.anychart.core.SeriesPoint set(String field, String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".set(%s, %s);", wrapQuotes(field), wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,642 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBase;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* This class is responsible of the text formatting, it processes the plain text and the text in HTML format.
|
||||
*/
|
||||
public class Text extends VisualBase {
|
||||
|
||||
protected Text() {
|
||||
|
||||
}
|
||||
|
||||
public static Text instantiate() {
|
||||
return new Text("new anychart.core.text()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Text(String jsChart) {
|
||||
jsBase = "text" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for the pointer events.
|
||||
*/
|
||||
public void disablePointerEvents() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".disablePointerEvents();");
|
||||
}
|
||||
/**
|
||||
* Setter for the pointer events.
|
||||
*/
|
||||
public com.anychart.core.Text disablePointerEvents(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".disablePointerEvents(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.Text enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text font color.
|
||||
*/
|
||||
public void fontColor() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fontColor();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text font color.<br/>
|
||||
{@link https://www.w3schools.com/html/html_colors.asp}
|
||||
*/
|
||||
public com.anychart.core.Text fontColor(String color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontColor(%s);", wrapQuotes(color)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text font decoration.
|
||||
*/
|
||||
public void fontDecoration() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fontDecoration();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text font decoration.
|
||||
*/
|
||||
public com.anychart.core.Text fontDecoration(com.anychart.graphics.vector.text.Decoration value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontDecoration(%s);", (value != null) ? value.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text font decoration.
|
||||
*/
|
||||
public com.anychart.core.Text fontDecoration(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontDecoration(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the font family.
|
||||
*/
|
||||
public void fontFamily() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fontFamily();");
|
||||
}
|
||||
/**
|
||||
* Setter for the font family.
|
||||
*/
|
||||
public com.anychart.core.Text fontFamily(String family) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontFamily(%s);", wrapQuotes(family)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text font opacity.
|
||||
*/
|
||||
public void fontOpacity() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fontOpacity();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text font opacity. Double value from 0 to 1.
|
||||
*/
|
||||
public com.anychart.core.Text fontOpacity(Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontOpacity(%s);", opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text font size.
|
||||
*/
|
||||
public void fontSize() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fontSize();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text font size.
|
||||
*/
|
||||
public com.anychart.core.Text fontSize(String size) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontSize(%s);", wrapQuotes(size)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text font size.
|
||||
*/
|
||||
public com.anychart.core.Text fontSize(Number size) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontSize(%s);", size));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text font style.
|
||||
*/
|
||||
public void fontStyle() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fontStyle();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text font style.
|
||||
*/
|
||||
public com.anychart.core.Text fontStyle(com.anychart.graphics.vector.text.FontStyle style) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontStyle(%s);", (style != null) ? style.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text font style.
|
||||
*/
|
||||
public com.anychart.core.Text fontStyle(String style) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontStyle(%s);", wrapQuotes(style)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text font variant.
|
||||
*/
|
||||
public void fontVariant() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fontVariant();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text font variant.
|
||||
*/
|
||||
public com.anychart.core.Text fontVariant(com.anychart.graphics.vector.text.FontVariant value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontVariant(%s);", (value != null) ? value.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text font variant.
|
||||
*/
|
||||
public com.anychart.core.Text fontVariant(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontVariant(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text font weight.
|
||||
*/
|
||||
public void fontWeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fontWeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text font weight.<br/>
|
||||
{@link https://www.w3schools.com/cssref/pr_font_weight.asp}
|
||||
*/
|
||||
public com.anychart.core.Text fontWeight(String weight) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontWeight(%s);", wrapQuotes(weight)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text font weight.<br/>
|
||||
{@link https://www.w3schools.com/cssref/pr_font_weight.asp}
|
||||
*/
|
||||
public com.anychart.core.Text fontWeight(Number weight) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fontWeight(%s);", weight));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text horizontal align.
|
||||
*/
|
||||
public void hAlign() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hAlign();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text horizontal align.
|
||||
*/
|
||||
public com.anychart.core.Text hAlign(com.anychart.graphics.vector.text.HAlign align) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hAlign(%s);", (align != null) ? align.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text horizontal align.
|
||||
*/
|
||||
public com.anychart.core.Text hAlign(String align) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hAlign(%s);", wrapQuotes(align)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text letter spacing.
|
||||
*/
|
||||
public void letterSpacing() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".letterSpacing();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text letter spacing.<br/>
|
||||
{@link https://www.w3schools.com/cssref/pr_text_letter-spacing.asp}
|
||||
*/
|
||||
public com.anychart.core.Text letterSpacing(String spacing) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".letterSpacing(%s);", wrapQuotes(spacing)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text letter spacing.<br/>
|
||||
{@link https://www.w3schools.com/cssref/pr_text_letter-spacing.asp}
|
||||
*/
|
||||
public com.anychart.core.Text letterSpacing(Number spacing) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".letterSpacing(%s);", spacing));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text line height.
|
||||
*/
|
||||
public void lineHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".lineHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text line height.<br/>
|
||||
{@link https://www.w3schools.com/cssref/pr_dim_line-height.asp}
|
||||
*/
|
||||
public com.anychart.core.Text lineHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".lineHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text line height.<br/>
|
||||
{@link https://www.w3schools.com/cssref/pr_dim_line-height.asp}
|
||||
*/
|
||||
public com.anychart.core.Text lineHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".lineHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for the text selectable option.
|
||||
*/
|
||||
public void selectable() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".selectable();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text selectable.
|
||||
*/
|
||||
public com.anychart.core.Text selectable(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selectable(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text direction.
|
||||
*/
|
||||
public void textDirection() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".textDirection();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text direction.
|
||||
*/
|
||||
public com.anychart.core.Text textDirection(com.anychart.graphics.vector.text.Direction direction) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".textDirection(%s);", (direction != null) ? direction.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text direction.
|
||||
*/
|
||||
public com.anychart.core.Text textDirection(String direction) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".textDirection(%s);", wrapQuotes(direction)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text indent.
|
||||
*/
|
||||
public void textIndent() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".textIndent();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text indent.
|
||||
*/
|
||||
public com.anychart.core.Text textIndent(Number indent) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".textIndent(%s);", indent));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text overflow settings.
|
||||
*/
|
||||
public void textOverflow() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".textOverflow();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text overflow settings.
|
||||
*/
|
||||
public com.anychart.core.Text textOverflow(com.anychart.graphics.vector.text.TextOverflow value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".textOverflow(%s);", (value != null) ? value.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text overflow settings.
|
||||
*/
|
||||
public com.anychart.core.Text textOverflow(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".textOverflow(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the full text appearance settings.
|
||||
*/
|
||||
public void textSettings() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".textSettings();");
|
||||
}
|
||||
/**
|
||||
* Getter for all text appearance settings.
|
||||
*/
|
||||
public void textSettings(String name) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".textSettings(%s);", wrapQuotes(name)));
|
||||
}
|
||||
/**
|
||||
* Setter for the text appearance settings.
|
||||
*/
|
||||
public com.anychart.core.Text textSettings(String name, String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".textSettings(%s, %s);", wrapQuotes(name), wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text appearance settings.
|
||||
*/
|
||||
public com.anychart.core.Text textSettings(String name, Number settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".textSettings(%s, %s);", wrapQuotes(name), settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text appearance settings.
|
||||
*/
|
||||
public com.anychart.core.Text textSettings(String name, Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".textSettings(%s, %s);", wrapQuotes(name), settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the useHTML flag.
|
||||
*/
|
||||
public void useHtml() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".useHtml();");
|
||||
}
|
||||
/**
|
||||
* Setter for flag useHTML.
|
||||
*/
|
||||
public com.anychart.core.Text useHtml(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".useHtml(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the text vertical align.
|
||||
*/
|
||||
public void vAlign() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".vAlign();");
|
||||
}
|
||||
/**
|
||||
* Setter for the text vertical align.
|
||||
*/
|
||||
public com.anychart.core.Text vAlign(com.anychart.graphics.vector.text.VAlign align) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".vAlign(%s);", (align != null) ? align.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the text vertical align.
|
||||
*/
|
||||
public com.anychart.core.Text vAlign(String align) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".vAlign(%s);", wrapQuotes(align)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the word-break mode.
|
||||
*/
|
||||
public void wordBreak() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".wordBreak();");
|
||||
}
|
||||
/**
|
||||
* Setter for the word-break mode.
|
||||
*/
|
||||
public com.anychart.core.Text wordBreak(com.anychart.enums.WordBreak mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".wordBreak(%s);", (mode != null) ? mode.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the word-break mode.
|
||||
*/
|
||||
public com.anychart.core.Text wordBreak(String mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".wordBreak(%s);", wrapQuotes(mode)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the word-wrap mode.
|
||||
*/
|
||||
public void wordWrap() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".wordWrap();");
|
||||
}
|
||||
/**
|
||||
* Setter for the word-wrap mode.
|
||||
*/
|
||||
public com.anychart.core.Text wordWrap(com.anychart.enums.WordWrap mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".wordWrap(%s);", (mode != null) ? mode.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the word-wrap mode.
|
||||
*/
|
||||
public com.anychart.core.Text wordWrap(String mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".wordWrap(%s);", wrapQuotes(mode)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.Text zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.Text container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.Text container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.Text container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.Text parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.Text parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.Text parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.Text parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.Point;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Class that wraps point of series or chart.
|
||||
*/
|
||||
public class TreeChartPoint extends Point {
|
||||
|
||||
protected TreeChartPoint() {
|
||||
|
||||
}
|
||||
|
||||
public static TreeChartPoint instantiate() {
|
||||
return new TreeChartPoint("new anychart.core.treeChartPoint()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public TreeChartPoint(String jsChart) {
|
||||
jsBase = "treeChartPoint" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the point exists.
|
||||
*/
|
||||
public void exists() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".exists();");
|
||||
}
|
||||
/**
|
||||
* Getter for the current value from data by path specified.
|
||||
*/
|
||||
public void get(String field) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".get(%s);", wrapQuotes(field)));
|
||||
}
|
||||
/**
|
||||
* Getter for the chart point belongs to.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Getter for the point linear index.
|
||||
*/
|
||||
public void getIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getIndex();");
|
||||
}
|
||||
/**
|
||||
* Returns a node.
|
||||
*/
|
||||
public com.anychart.data.tree.DataItem getNode() {
|
||||
return new com.anychart.data.tree.DataItem(jsBase + ".getNode()");
|
||||
}
|
||||
/**
|
||||
* Getter for the hover point state.
|
||||
*/
|
||||
public void hovered() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hovered();");
|
||||
}
|
||||
/**
|
||||
* Setter for the hover point state.
|
||||
*/
|
||||
public com.anychart.core.TreeChartPoint hovered(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the select point state.
|
||||
*/
|
||||
public void selected() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".selected();");
|
||||
}
|
||||
/**
|
||||
* Setter for the select point state.
|
||||
*/
|
||||
public com.anychart.core.TreeChartPoint selected(Boolean value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", value));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the value to the data by path.
|
||||
*/
|
||||
public com.anychart.core.TreeChartPoint set(String field, String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".set(%s, %s);", wrapQuotes(field), wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(com.anychart.enums.Statistics key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", (key != null) ? key.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Getter for the statistics value by key.
|
||||
*/
|
||||
public void getStat(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".getStat(%s);", wrapQuotes(key)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.Base;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Base class for all elements.
|
||||
*/
|
||||
public class VisualBase extends Base {
|
||||
|
||||
protected VisualBase() {
|
||||
|
||||
}
|
||||
|
||||
public static VisualBase instantiate() {
|
||||
return new VisualBase("new anychart.core.visualBase()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public VisualBase(String jsChart) {
|
||||
jsBase = "visualBase" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.VisualBase container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.VisualBase container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.VisualBase container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.VisualBase enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.VisualBase parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.VisualBase parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.VisualBase parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.VisualBase parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.VisualBase zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,599 @@
|
||||
package com.anychart.core;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBase;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* An extended base element that understands bounds settings and can handle percent values in it.
|
||||
*/
|
||||
public class VisualBaseWithBounds extends VisualBase {
|
||||
|
||||
protected VisualBaseWithBounds() {
|
||||
|
||||
}
|
||||
|
||||
public static VisualBaseWithBounds instantiate() {
|
||||
return new VisualBaseWithBounds("new anychart.core.visualBaseWithBounds()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public VisualBaseWithBounds(String jsChart) {
|
||||
jsBase = "visualBaseWithBounds" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for element bottom bound settings.
|
||||
*/
|
||||
public void bottom() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".bottom();");
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bottom(Number bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", bottom));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bottom(String bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", wrapQuotes(bottom)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.utils.Bounds bounds() {
|
||||
return new com.anychart.core.utils.Bounds(jsBase + ".bounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(com.anychart.utils.RectObj bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(com.anychart.core.utils.Bounds bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(Number x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(Number x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(Number x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(Number x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(Number x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(Number x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(Number x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(Number x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(String x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(String x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(String x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(String x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(String x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(String x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(String x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds bounds(String x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns pixel bounds of the element due to parent bounds and self bounds settings.
|
||||
*/
|
||||
public com.anychart.math.Rect getPixelBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getPixelBounds()");
|
||||
}
|
||||
/**
|
||||
* Getter for element height settings.
|
||||
*/
|
||||
public void height() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".height();");
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds height(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds height(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element left bound settings.
|
||||
*/
|
||||
public void left() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".left();");
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds left(Number left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", left));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds left(String left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", wrapQuotes(left)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum height.
|
||||
*/
|
||||
public void maxHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds maxHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds maxHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum width.
|
||||
*/
|
||||
public void maxWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds maxWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds maxWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum height.
|
||||
*/
|
||||
public void minHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds minHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds minHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum width.
|
||||
*/
|
||||
public void minWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds minWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds minWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for element right bound settings.
|
||||
*/
|
||||
public void right() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".right();");
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds right(Number right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", right));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds right(String right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", wrapQuotes(right)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element top bound settings.
|
||||
*/
|
||||
public void top() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".top();");
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds top(Number top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", top));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds top(String top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", wrapQuotes(top)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for element width settings.
|
||||
*/
|
||||
public void width() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".width();");
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds width(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds width(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.VisualBaseWithBounds parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
+1040
File diff suppressed because it is too large
Load Diff
+54
@@ -0,0 +1,54 @@
|
||||
package com.anychart.core.annotations;
|
||||
|
||||
import com.anychart.JsObject;
|
||||
|
||||
import com.anychart.enums.Anchor;
|
||||
import com.anychart.graphics.vector.AnyColor;
|
||||
import com.anychart.graphics.vector.Fill;
|
||||
import com.anychart.graphics.vector.Stroke;
|
||||
import com.anychart.graphics.vector.PatternFill;
|
||||
import com.anychart.core.StateSettings;
|
||||
import com.anychart.enums.MarkerType;
|
||||
import com.anychart.enums.AnnotationTypes;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
|
||||
// typedef
|
||||
/**
|
||||
* Type definition for annotation JSON format.
|
||||
*/
|
||||
public class AnnotationJSONFormat extends JsObject {
|
||||
|
||||
|
||||
public AnnotationJSONFormat(Boolean allowEdit, Anchor anchor, AnyColor color, Fill fill, Stroke grid, PatternFill hatchFill, Number hoverGap, StateSettings hovered, MarkerType markerType, Number offsetX, Number offsetY, Number secondValueAnchor, Number secondXAnchor, StateSettings selected, Number size, Stroke stroke, Number thirdValueAnchor, Number thirdXAnchor, Stroke trend, String type, Number valueAnchor, Number xAnchor) {
|
||||
js.append(String.format(Locale.US, "{allowEdit:%s, anchor: %s, color: %s, fill: %s, grid: %s, hatchFill: %s, hoverGap: %s, hovered: %s, markerType: %s, offsetX: %s, offsetY: %s, secondValueAnchor: %s, secondXAnchor: %s, selected: %s, size: %s, stroke: %s, thirdValueAnchor: %s, thirdXAnchor: %s, trend: %s, type: %s, valueAnchor: %s, xAnchor: %s, } ", allowEdit, (anchor != null) ? anchor.getJsBase() : null, (color != null) ? color.getJsBase() : null, (fill != null) ? fill.getJsBase() : null, (grid != null) ? grid.getJsBase() : null, (hatchFill != null) ? hatchFill.getJsBase() : null, hoverGap, (hovered != null) ? hovered.getJsBase() : null, (markerType != null) ? markerType.getJsBase() : null, offsetX, offsetY, secondValueAnchor, secondXAnchor, (selected != null) ? selected.getJsBase() : null, size, (stroke != null) ? stroke.getJsBase() : null, thirdValueAnchor, thirdXAnchor, (trend != null) ? trend.getJsBase() : null, wrapQuotes(type), valueAnchor, xAnchor));
|
||||
}
|
||||
public AnnotationJSONFormat(Boolean allowEdit, Anchor anchor, AnyColor color, Fill fill, Stroke grid, PatternFill hatchFill, Number hoverGap, StateSettings hovered, MarkerType markerType, Number offsetX, Number offsetY, Number secondValueAnchor, Number secondXAnchor, StateSettings selected, Number size, Stroke stroke, Number thirdValueAnchor, Number thirdXAnchor, Stroke trend, AnnotationTypes type, Number valueAnchor, Number xAnchor) {
|
||||
js.append(String.format(Locale.US, "{allowEdit:%s, anchor: %s, color: %s, fill: %s, grid: %s, hatchFill: %s, hoverGap: %s, hovered: %s, markerType: %s, offsetX: %s, offsetY: %s, secondValueAnchor: %s, secondXAnchor: %s, selected: %s, size: %s, stroke: %s, thirdValueAnchor: %s, thirdXAnchor: %s, trend: %s, type: %s, valueAnchor: %s, xAnchor: %s, } ", allowEdit, (anchor != null) ? anchor.getJsBase() : null, (color != null) ? color.getJsBase() : null, (fill != null) ? fill.getJsBase() : null, (grid != null) ? grid.getJsBase() : null, (hatchFill != null) ? hatchFill.getJsBase() : null, hoverGap, (hovered != null) ? hovered.getJsBase() : null, (markerType != null) ? markerType.getJsBase() : null, offsetX, offsetY, secondValueAnchor, secondXAnchor, (selected != null) ? selected.getJsBase() : null, size, (stroke != null) ? stroke.getJsBase() : null, thirdValueAnchor, thirdXAnchor, (trend != null) ? trend.getJsBase() : null, (type != null) ? type.getJsBase() : null, valueAnchor, xAnchor));
|
||||
}
|
||||
public AnnotationJSONFormat(Boolean allowEdit, Anchor anchor, AnyColor color, Fill fill, Stroke grid, PatternFill hatchFill, Number hoverGap, StateSettings hovered, String markerType, Number offsetX, Number offsetY, Number secondValueAnchor, Number secondXAnchor, StateSettings selected, Number size, Stroke stroke, Number thirdValueAnchor, Number thirdXAnchor, Stroke trend, String type, Number valueAnchor, Number xAnchor) {
|
||||
js.append(String.format(Locale.US, "{allowEdit:%s, anchor: %s, color: %s, fill: %s, grid: %s, hatchFill: %s, hoverGap: %s, hovered: %s, markerType: %s, offsetX: %s, offsetY: %s, secondValueAnchor: %s, secondXAnchor: %s, selected: %s, size: %s, stroke: %s, thirdValueAnchor: %s, thirdXAnchor: %s, trend: %s, type: %s, valueAnchor: %s, xAnchor: %s, } ", allowEdit, (anchor != null) ? anchor.getJsBase() : null, (color != null) ? color.getJsBase() : null, (fill != null) ? fill.getJsBase() : null, (grid != null) ? grid.getJsBase() : null, (hatchFill != null) ? hatchFill.getJsBase() : null, hoverGap, (hovered != null) ? hovered.getJsBase() : null, wrapQuotes(markerType), offsetX, offsetY, secondValueAnchor, secondXAnchor, (selected != null) ? selected.getJsBase() : null, size, (stroke != null) ? stroke.getJsBase() : null, thirdValueAnchor, thirdXAnchor, (trend != null) ? trend.getJsBase() : null, wrapQuotes(type), valueAnchor, xAnchor));
|
||||
}
|
||||
public AnnotationJSONFormat(Boolean allowEdit, Anchor anchor, AnyColor color, Fill fill, Stroke grid, PatternFill hatchFill, Number hoverGap, StateSettings hovered, String markerType, Number offsetX, Number offsetY, Number secondValueAnchor, Number secondXAnchor, StateSettings selected, Number size, Stroke stroke, Number thirdValueAnchor, Number thirdXAnchor, Stroke trend, AnnotationTypes type, Number valueAnchor, Number xAnchor) {
|
||||
js.append(String.format(Locale.US, "{allowEdit:%s, anchor: %s, color: %s, fill: %s, grid: %s, hatchFill: %s, hoverGap: %s, hovered: %s, markerType: %s, offsetX: %s, offsetY: %s, secondValueAnchor: %s, secondXAnchor: %s, selected: %s, size: %s, stroke: %s, thirdValueAnchor: %s, thirdXAnchor: %s, trend: %s, type: %s, valueAnchor: %s, xAnchor: %s, } ", allowEdit, (anchor != null) ? anchor.getJsBase() : null, (color != null) ? color.getJsBase() : null, (fill != null) ? fill.getJsBase() : null, (grid != null) ? grid.getJsBase() : null, (hatchFill != null) ? hatchFill.getJsBase() : null, hoverGap, (hovered != null) ? hovered.getJsBase() : null, wrapQuotes(markerType), offsetX, offsetY, secondValueAnchor, secondXAnchor, (selected != null) ? selected.getJsBase() : null, size, (stroke != null) ? stroke.getJsBase() : null, thirdValueAnchor, thirdXAnchor, (trend != null) ? trend.getJsBase() : null, (type != null) ? type.getJsBase() : null, valueAnchor, xAnchor));
|
||||
}
|
||||
public AnnotationJSONFormat(Boolean allowEdit, String anchor, AnyColor color, Fill fill, Stroke grid, PatternFill hatchFill, Number hoverGap, StateSettings hovered, MarkerType markerType, Number offsetX, Number offsetY, Number secondValueAnchor, Number secondXAnchor, StateSettings selected, Number size, Stroke stroke, Number thirdValueAnchor, Number thirdXAnchor, Stroke trend, String type, Number valueAnchor, Number xAnchor) {
|
||||
js.append(String.format(Locale.US, "{allowEdit:%s, anchor: %s, color: %s, fill: %s, grid: %s, hatchFill: %s, hoverGap: %s, hovered: %s, markerType: %s, offsetX: %s, offsetY: %s, secondValueAnchor: %s, secondXAnchor: %s, selected: %s, size: %s, stroke: %s, thirdValueAnchor: %s, thirdXAnchor: %s, trend: %s, type: %s, valueAnchor: %s, xAnchor: %s, } ", allowEdit, wrapQuotes(anchor), (color != null) ? color.getJsBase() : null, (fill != null) ? fill.getJsBase() : null, (grid != null) ? grid.getJsBase() : null, (hatchFill != null) ? hatchFill.getJsBase() : null, hoverGap, (hovered != null) ? hovered.getJsBase() : null, (markerType != null) ? markerType.getJsBase() : null, offsetX, offsetY, secondValueAnchor, secondXAnchor, (selected != null) ? selected.getJsBase() : null, size, (stroke != null) ? stroke.getJsBase() : null, thirdValueAnchor, thirdXAnchor, (trend != null) ? trend.getJsBase() : null, wrapQuotes(type), valueAnchor, xAnchor));
|
||||
}
|
||||
public AnnotationJSONFormat(Boolean allowEdit, String anchor, AnyColor color, Fill fill, Stroke grid, PatternFill hatchFill, Number hoverGap, StateSettings hovered, MarkerType markerType, Number offsetX, Number offsetY, Number secondValueAnchor, Number secondXAnchor, StateSettings selected, Number size, Stroke stroke, Number thirdValueAnchor, Number thirdXAnchor, Stroke trend, AnnotationTypes type, Number valueAnchor, Number xAnchor) {
|
||||
js.append(String.format(Locale.US, "{allowEdit:%s, anchor: %s, color: %s, fill: %s, grid: %s, hatchFill: %s, hoverGap: %s, hovered: %s, markerType: %s, offsetX: %s, offsetY: %s, secondValueAnchor: %s, secondXAnchor: %s, selected: %s, size: %s, stroke: %s, thirdValueAnchor: %s, thirdXAnchor: %s, trend: %s, type: %s, valueAnchor: %s, xAnchor: %s, } ", allowEdit, wrapQuotes(anchor), (color != null) ? color.getJsBase() : null, (fill != null) ? fill.getJsBase() : null, (grid != null) ? grid.getJsBase() : null, (hatchFill != null) ? hatchFill.getJsBase() : null, hoverGap, (hovered != null) ? hovered.getJsBase() : null, (markerType != null) ? markerType.getJsBase() : null, offsetX, offsetY, secondValueAnchor, secondXAnchor, (selected != null) ? selected.getJsBase() : null, size, (stroke != null) ? stroke.getJsBase() : null, thirdValueAnchor, thirdXAnchor, (trend != null) ? trend.getJsBase() : null, (type != null) ? type.getJsBase() : null, valueAnchor, xAnchor));
|
||||
}
|
||||
public AnnotationJSONFormat(Boolean allowEdit, String anchor, AnyColor color, Fill fill, Stroke grid, PatternFill hatchFill, Number hoverGap, StateSettings hovered, String markerType, Number offsetX, Number offsetY, Number secondValueAnchor, Number secondXAnchor, StateSettings selected, Number size, Stroke stroke, Number thirdValueAnchor, Number thirdXAnchor, Stroke trend, String type, Number valueAnchor, Number xAnchor) {
|
||||
js.append(String.format(Locale.US, "{allowEdit:%s, anchor: %s, color: %s, fill: %s, grid: %s, hatchFill: %s, hoverGap: %s, hovered: %s, markerType: %s, offsetX: %s, offsetY: %s, secondValueAnchor: %s, secondXAnchor: %s, selected: %s, size: %s, stroke: %s, thirdValueAnchor: %s, thirdXAnchor: %s, trend: %s, type: %s, valueAnchor: %s, xAnchor: %s, } ", allowEdit, wrapQuotes(anchor), (color != null) ? color.getJsBase() : null, (fill != null) ? fill.getJsBase() : null, (grid != null) ? grid.getJsBase() : null, (hatchFill != null) ? hatchFill.getJsBase() : null, hoverGap, (hovered != null) ? hovered.getJsBase() : null, wrapQuotes(markerType), offsetX, offsetY, secondValueAnchor, secondXAnchor, (selected != null) ? selected.getJsBase() : null, size, (stroke != null) ? stroke.getJsBase() : null, thirdValueAnchor, thirdXAnchor, (trend != null) ? trend.getJsBase() : null, wrapQuotes(type), valueAnchor, xAnchor));
|
||||
}
|
||||
public AnnotationJSONFormat(Boolean allowEdit, String anchor, AnyColor color, Fill fill, Stroke grid, PatternFill hatchFill, Number hoverGap, StateSettings hovered, String markerType, Number offsetX, Number offsetY, Number secondValueAnchor, Number secondXAnchor, StateSettings selected, Number size, Stroke stroke, Number thirdValueAnchor, Number thirdXAnchor, Stroke trend, AnnotationTypes type, Number valueAnchor, Number xAnchor) {
|
||||
js.append(String.format(Locale.US, "{allowEdit:%s, anchor: %s, color: %s, fill: %s, grid: %s, hatchFill: %s, hoverGap: %s, hovered: %s, markerType: %s, offsetX: %s, offsetY: %s, secondValueAnchor: %s, secondXAnchor: %s, selected: %s, size: %s, stroke: %s, thirdValueAnchor: %s, thirdXAnchor: %s, trend: %s, type: %s, valueAnchor: %s, xAnchor: %s, } ", allowEdit, wrapQuotes(anchor), (color != null) ? color.getJsBase() : null, (fill != null) ? fill.getJsBase() : null, (grid != null) ? grid.getJsBase() : null, (hatchFill != null) ? hatchFill.getJsBase() : null, hoverGap, (hovered != null) ? hovered.getJsBase() : null, wrapQuotes(markerType), offsetX, offsetY, secondValueAnchor, secondXAnchor, (selected != null) ? selected.getJsBase() : null, size, (stroke != null) ? stroke.getJsBase() : null, thirdValueAnchor, thirdXAnchor, (trend != null) ? trend.getJsBase() : null, (type != null) ? type.getJsBase() : null, valueAnchor, xAnchor));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJsBase() {
|
||||
return js.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,834 @@
|
||||
package com.anychart.core.annotations;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBaseWithBounds;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Base annotations class.
|
||||
*/
|
||||
public class Base extends VisualBaseWithBounds {
|
||||
|
||||
protected Base() {
|
||||
|
||||
}
|
||||
|
||||
public static Base instantiate() {
|
||||
return new Base("new anychart.core.annotations.base()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Base(String jsChart) {
|
||||
jsBase = "base" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for an interactivity in the annotation.
|
||||
*/
|
||||
public void allowEdit() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".allowEdit();");
|
||||
}
|
||||
/**
|
||||
* Setter for an interactivity in the annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base allowEdit(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".allowEdit(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element bottom bound settings.
|
||||
*/
|
||||
public void bottom() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".bottom();");
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bottom(Number bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", bottom));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bottom(String bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", wrapQuotes(bottom)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.utils.Bounds bounds() {
|
||||
return new com.anychart.core.utils.Bounds(jsBase + ".bounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(com.anychart.utils.RectObj bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(com.anychart.core.utils.Bounds bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(Number x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(Number x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(Number x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(Number x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(Number x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(Number x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(Number x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(Number x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(String x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(String x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(String x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(String x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(String x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(String x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(String x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base bounds(String x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the annotation color.
|
||||
*/
|
||||
public void color() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".color();");
|
||||
}
|
||||
/**
|
||||
* Setter for the annotation color.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base color(String color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".color(%s);", wrapQuotes(color)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns the chart on which the annotation is drawn.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Returns pixel bounds of the element due to parent bounds and self bounds settings.
|
||||
*/
|
||||
public com.anychart.math.Rect getPixelBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getPixelBounds()");
|
||||
}
|
||||
/**
|
||||
* Returns the plot on which the annotation is drawn.
|
||||
*/
|
||||
public com.anychart.core.stock.Plot getPlot() {
|
||||
return new com.anychart.core.stock.Plot(jsBase + ".getPlot()");
|
||||
}
|
||||
/**
|
||||
* Returns annotation type.
|
||||
*/
|
||||
public void getType() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getType();");
|
||||
}
|
||||
/**
|
||||
* Getter for element height settings.
|
||||
*/
|
||||
public void height() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".height();");
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base height(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base height(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the hover gap.
|
||||
*/
|
||||
public void hoverGap() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hoverGap();");
|
||||
}
|
||||
/**
|
||||
* Setter for the hover gap.<br/>
|
||||
The contour size around annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base hoverGap(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hoverGap(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for hovered state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings hovered() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".hovered()");
|
||||
}
|
||||
/**
|
||||
* Setter for hovered state settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base hovered(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element left bound settings.
|
||||
*/
|
||||
public void left() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".left();");
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base left(Number left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", left));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base left(String left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", wrapQuotes(left)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for data markers.
|
||||
*/
|
||||
public com.anychart.core.ui.MarkersFactory markers() {
|
||||
return new com.anychart.core.ui.MarkersFactory(jsBase + ".markers()");
|
||||
}
|
||||
/**
|
||||
* Setter for data markers.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base markers(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".markers(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for data markers.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base markers(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".markers(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum height.
|
||||
*/
|
||||
public void maxHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base maxHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base maxHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum width.
|
||||
*/
|
||||
public void maxWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base maxWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base maxWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum height.
|
||||
*/
|
||||
public void minHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base minHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base minHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum width.
|
||||
*/
|
||||
public void minWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base minWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base minWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for normal state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings normal() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".normal()");
|
||||
}
|
||||
/**
|
||||
* Setter for normal state settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base normal(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".normal(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for element right bound settings.
|
||||
*/
|
||||
public void right() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".right();");
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base right(Number right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", right));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base right(String right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", wrapQuotes(right)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Selects current annotation.
|
||||
*/
|
||||
public void select() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".select();");
|
||||
}
|
||||
/**
|
||||
* Getter for selected state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings selected() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".selected()");
|
||||
}
|
||||
/**
|
||||
* Setter for selected state settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base selected(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element top bound settings.
|
||||
*/
|
||||
public void top() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".top();");
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base top(Number top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", top));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base top(String top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", wrapQuotes(top)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for element width settings.
|
||||
*/
|
||||
public void width() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".width();");
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base width(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base width(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the X-scale.
|
||||
*/
|
||||
public com.anychart.scales.Ordinal xScale() {
|
||||
return new com.anychart.scales.Ordinal(jsBase + ".xScale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base xScale(com.anychart.scales.Base settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base xScale(com.anychart.scales.StockScatterDateTime settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base xScale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base xScale(com.anychart.enums.ScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.scales.Base yScale() {
|
||||
return new com.anychart.scales.Base(jsBase + ".yScale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base yScale(com.anychart.scales.Base settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".yScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base yScale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".yScale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base yScale(com.anychart.enums.ScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".yScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Object xScale(Class scaleClass) {
|
||||
Object instance = null;
|
||||
try {
|
||||
instance = scaleClass.getDeclaredConstructor(String.class).newInstance(jsBase + ".xScale()");
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.lang.reflect.InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Object yScale(Class scaleClass) {
|
||||
Object instance = null;
|
||||
try {
|
||||
instance = scaleClass.getDeclaredConstructor(String.class).newInstance(jsBase + ".yScale()");
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.lang.reflect.InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
}
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
package com.anychart.core.annotations;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.Base;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Chart controller class.
|
||||
*/
|
||||
public class ChartController extends Base {
|
||||
|
||||
protected ChartController() {
|
||||
|
||||
}
|
||||
|
||||
public static ChartController instantiate() {
|
||||
return new ChartController("new anychart.core.annotations.chartController()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ChartController(String jsChart) {
|
||||
jsBase = "chartController" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cancels current annotation drawing.
|
||||
*/
|
||||
public void cancelDrawing() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".cancelDrawing();");
|
||||
}
|
||||
/**
|
||||
* Returns currently selected annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base getSelectedAnnotation() {
|
||||
return new com.anychart.core.annotations.Base(jsBase + ".getSelectedAnnotation()");
|
||||
}
|
||||
/**
|
||||
* Removes all annotations from the chart.
|
||||
*/
|
||||
public com.anychart.core.annotations.ChartController removeAllAnnotations() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".removeAllAnnotations();");
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Removes one of annotations from plot by its instance.
|
||||
*/
|
||||
public com.anychart.core.annotations.ChartController removeAnnotation(com.anychart.core.annotations.Base annotation) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAnnotation(%s);", (annotation != null) ? annotation.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Selects annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.ChartController select(com.anychart.core.annotations.Base annotation) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".select(%s);", (annotation != null) ? annotation.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Starts annotation drawing.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Stock#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base startDrawing(com.anychart.enums.AnnotationTypes annotationTypeOrConfig) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".startDrawing(%s)", (annotationTypeOrConfig != null) ? annotationTypeOrConfig.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Starts annotation drawing.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Stock#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base startDrawing(String annotationTypeOrConfig) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".startDrawing(%s)", wrapQuotes(annotationTypeOrConfig)));
|
||||
}
|
||||
/**
|
||||
* Starts annotation drawing.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Stock#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base startDrawing(com.anychart.core.annotations.AnnotationJSONFormat annotationTypeOrConfig) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".startDrawing(%s)", (annotationTypeOrConfig != null) ? annotationTypeOrConfig.getJsBase() : null));
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Unselects annotations.
|
||||
*/
|
||||
public com.anychart.core.annotations.ChartController unselect() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".unselect();");
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+1162
File diff suppressed because it is too large
Load Diff
+1162
File diff suppressed because it is too large
Load Diff
+1290
File diff suppressed because it is too large
Load Diff
+1162
File diff suppressed because it is too large
Load Diff
+1162
File diff suppressed because it is too large
Load Diff
+970
@@ -0,0 +1,970 @@
|
||||
package com.anychart.core.annotations;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.annotations.Base;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Horizontal Line annotation.
|
||||
*/
|
||||
public class HorizontalLine extends Base {
|
||||
|
||||
protected HorizontalLine() {
|
||||
|
||||
}
|
||||
|
||||
public static HorizontalLine instantiate() {
|
||||
return new HorizontalLine("new anychart.core.annotations.horizontalLine()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public HorizontalLine(String jsChart) {
|
||||
jsBase = "horizontalLine" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for an interactivity in the annotation.
|
||||
*/
|
||||
public void allowEdit() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".allowEdit();");
|
||||
}
|
||||
/**
|
||||
* Setter for an interactivity in the annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine allowEdit(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".allowEdit(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the annotation color.
|
||||
*/
|
||||
public void color() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".color();");
|
||||
}
|
||||
/**
|
||||
* Setter for the annotation color.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine color(String color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".color(%s);", wrapQuotes(color)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns the chart on which the annotation is drawn.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Returns the plot on which the annotation is drawn.
|
||||
*/
|
||||
public com.anychart.core.stock.Plot getPlot() {
|
||||
return new com.anychart.core.stock.Plot(jsBase + ".getPlot()");
|
||||
}
|
||||
/**
|
||||
* Returns annotation type.
|
||||
*/
|
||||
public void getType() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getType();");
|
||||
}
|
||||
/**
|
||||
* Getter for the hover gap.
|
||||
*/
|
||||
public void hoverGap() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hoverGap();");
|
||||
}
|
||||
/**
|
||||
* Setter for the hover gap.<br/>
|
||||
The contour size around annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine hoverGap(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hoverGap(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for hovered state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings hovered() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".hovered()");
|
||||
}
|
||||
/**
|
||||
* Setter for hovered state settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine hovered(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for data markers.
|
||||
*/
|
||||
public com.anychart.core.ui.MarkersFactory markers() {
|
||||
return new com.anychart.core.ui.MarkersFactory(jsBase + ".markers()");
|
||||
}
|
||||
/**
|
||||
* Setter for data markers.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine markers(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".markers(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for data markers.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine markers(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".markers(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for normal state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings normal() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".normal()");
|
||||
}
|
||||
/**
|
||||
* Setter for normal state settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine normal(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".normal(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Selects current annotation.
|
||||
*/
|
||||
public void select() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".select();");
|
||||
}
|
||||
/**
|
||||
* Getter for selected state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings selected() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".selected()");
|
||||
}
|
||||
/**
|
||||
* Setter for selected state settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine selected(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for stroke settings.
|
||||
*/
|
||||
public void stroke() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".stroke();");
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(String color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(String color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(String color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotations stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(String color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings using an object.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine stroke(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the value anchor.
|
||||
*/
|
||||
public void valueAnchor() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".valueAnchor();");
|
||||
}
|
||||
/**
|
||||
* Setter for the value anchor.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine valueAnchor(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".valueAnchor(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the X-scale.
|
||||
*/
|
||||
public com.anychart.scales.Ordinal xScale() {
|
||||
return new com.anychart.scales.Ordinal(jsBase + ".xScale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine xScale(com.anychart.scales.Base settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine xScale(com.anychart.scales.StockScatterDateTime settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine xScale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine xScale(com.anychart.enums.ScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.scales.Base yScale() {
|
||||
return new com.anychart.scales.Base(jsBase + ".yScale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine yScale(com.anychart.scales.Base settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".yScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine yScale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".yScale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine yScale(com.anychart.enums.ScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".yScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element bottom bound settings.
|
||||
*/
|
||||
public void bottom() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".bottom();");
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bottom(Number bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", bottom));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bottom(String bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", wrapQuotes(bottom)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.utils.Bounds bounds() {
|
||||
return new com.anychart.core.utils.Bounds(jsBase + ".bounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(com.anychart.utils.RectObj bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(com.anychart.core.utils.Bounds bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(Number x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(Number x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(Number x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(Number x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(Number x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(Number x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(Number x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(Number x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(String x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(String x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(String x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(String x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(String x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(String x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(String x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine bounds(String x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns pixel bounds of the element due to parent bounds and self bounds settings.
|
||||
*/
|
||||
public com.anychart.math.Rect getPixelBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getPixelBounds()");
|
||||
}
|
||||
/**
|
||||
* Getter for element height settings.
|
||||
*/
|
||||
public void height() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".height();");
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine height(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine height(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element left bound settings.
|
||||
*/
|
||||
public void left() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".left();");
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine left(Number left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", left));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine left(String left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", wrapQuotes(left)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum height.
|
||||
*/
|
||||
public void maxHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine maxHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine maxHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum width.
|
||||
*/
|
||||
public void maxWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine maxWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine maxWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum height.
|
||||
*/
|
||||
public void minHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine minHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine minHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum width.
|
||||
*/
|
||||
public void minWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine minWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine minWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for element right bound settings.
|
||||
*/
|
||||
public void right() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".right();");
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine right(Number right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", right));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine right(String right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", wrapQuotes(right)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element top bound settings.
|
||||
*/
|
||||
public void top() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".top();");
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine top(Number top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", top));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine top(String top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", wrapQuotes(top)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for element width settings.
|
||||
*/
|
||||
public void width() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".width();");
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine width(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine width(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Object xScale(Class scaleClass) {
|
||||
Object instance = null;
|
||||
try {
|
||||
instance = scaleClass.getDeclaredConstructor(String.class).newInstance(jsBase + ".xScale()");
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.lang.reflect.InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Object yScale(Class scaleClass) {
|
||||
Object instance = null;
|
||||
try {
|
||||
instance = scaleClass.getDeclaredConstructor(String.class).newInstance(jsBase + ".yScale()");
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.lang.reflect.InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
}
|
||||
+1012
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+442
@@ -0,0 +1,442 @@
|
||||
package com.anychart.core.annotations;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBase;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Plot controller class.
|
||||
*/
|
||||
public class PlotController extends VisualBase {
|
||||
|
||||
protected PlotController() {
|
||||
|
||||
}
|
||||
|
||||
public static PlotController instantiate() {
|
||||
return new PlotController("new anychart.core.annotations.plotController()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public PlotController(String jsChart) {
|
||||
jsBase = "plotController" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds annotation on the plot.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base add(com.anychart.enums.AnnotationTypes annotationTypeOrConfig) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".add(%s)", (annotationTypeOrConfig != null) ? annotationTypeOrConfig.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Adds annotation on the plot.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base add(String annotationTypeOrConfig) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".add(%s)", wrapQuotes(annotationTypeOrConfig)));
|
||||
}
|
||||
/**
|
||||
* Adds annotation on the plot.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base add(com.anychart.core.annotations.AnnotationJSONFormat annotationTypeOrConfig) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".add(%s)", (annotationTypeOrConfig != null) ? annotationTypeOrConfig.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Creates and returns an Andrews Pitchfork annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.AndrewsPitchfork andrewsPitchfork(String settings) {
|
||||
return new com.anychart.core.annotations.AndrewsPitchfork(String.format(Locale.US, jsBase + ".andrewsPitchfork(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Cancels current annotation drawing.
|
||||
*/
|
||||
public void cancelDrawing() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".cancelDrawing();");
|
||||
}
|
||||
/**
|
||||
* Creates and returns an Ellipse annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Ellipse ellipse(String settings) {
|
||||
return new com.anychart.core.annotations.Ellipse(String.format(Locale.US, jsBase + ".ellipse(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Getter for the enabled state.
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the enabled state.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Fibonacci Arc annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.FibonacciArc fibonacciArc(String settings) {
|
||||
return new com.anychart.core.annotations.FibonacciArc(String.format(Locale.US, jsBase + ".fibonacciArc(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Fibonacci Fan annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.FibonacciFan fibonacciFan(String settings) {
|
||||
return new com.anychart.core.annotations.FibonacciFan(String.format(Locale.US, jsBase + ".fibonacciFan(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Fibonacci Retracement annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.FibonacciRetracement fibonacciRetracement(String settings) {
|
||||
return new com.anychart.core.annotations.FibonacciRetracement(String.format(Locale.US, jsBase + ".fibonacciRetracement(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Fibonacci Timezones annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.FibonacciTimezones fibonacciTimezones(String settings) {
|
||||
return new com.anychart.core.annotations.FibonacciTimezones(String.format(Locale.US, jsBase + ".fibonacciTimezones(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates annotations list by JSON config.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController fromJson(String config) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fromJson(%s);", wrapQuotes(config)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Creates annotations list by XML config.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController fromXml(String config) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fromXml(%s);", wrapQuotes(config)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns annotation by index.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base getAnnotationAt(Number index) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".getAnnotationAt(%s)", index));
|
||||
}
|
||||
/**
|
||||
* Returns annotations count.
|
||||
*/
|
||||
public void getAnnotationsCount() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getAnnotationsCount();");
|
||||
}
|
||||
/**
|
||||
* Returns currently selected annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base getSelectedAnnotation() {
|
||||
return new com.anychart.core.annotations.Base(jsBase + ".getSelectedAnnotation()");
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Horizontal Line annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.HorizontalLine horizontalLine(String settings) {
|
||||
return new com.anychart.core.annotations.HorizontalLine(String.format(Locale.US, jsBase + ".horizontalLine(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates and returns an Infinite Line annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.InfiniteLine infiniteLine(String settings) {
|
||||
return new com.anychart.core.annotations.InfiniteLine(String.format(Locale.US, jsBase + ".infiniteLine(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Label annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Label label(String settings) {
|
||||
return new com.anychart.core.annotations.Label(String.format(Locale.US, jsBase + ".label(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Line annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Line line(String settings) {
|
||||
return new com.anychart.core.annotations.Line(String.format(Locale.US, jsBase + ".line(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Marker annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Marker marker(String settings) {
|
||||
return new com.anychart.core.annotations.Marker(String.format(Locale.US, jsBase + ".marker(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Ray annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Ray ray(String settings) {
|
||||
return new com.anychart.core.annotations.Ray(String.format(Locale.US, jsBase + ".ray(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Rectangle annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Rectangle rectangle(String settings) {
|
||||
return new com.anychart.core.annotations.Rectangle(String.format(Locale.US, jsBase + ".rectangle(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Removes all annotations from a plot.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController removeAllAnnotations() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".removeAllAnnotations();");
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Removes an annotation from a plot by its instance.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController removeAnnotation(com.anychart.core.annotations.Base annotation) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAnnotation(%s);", (annotation != null) ? annotation.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Removes an annotation from a plot by its index.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController removeAnnotationAt(Number index) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAnnotationAt(%s);", index));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Selects annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController select(com.anychart.core.annotations.Base annotation) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".select(%s);", (annotation != null) ? annotation.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Starts annotation drawing.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Cartesian#draw} and {@link anychart.charts.Stock#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base startDrawing(com.anychart.enums.AnnotationTypes annotationTypeOrConfig) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".startDrawing(%s)", (annotationTypeOrConfig != null) ? annotationTypeOrConfig.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Starts annotation drawing.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Cartesian#draw} and {@link anychart.charts.Stock#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base startDrawing(String annotationTypeOrConfig) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".startDrawing(%s)", wrapQuotes(annotationTypeOrConfig)));
|
||||
}
|
||||
/**
|
||||
* Starts annotation drawing.<br/>
|
||||
<b>Note:</b> Works only after {@link anychart.charts.Cartesian#draw} and {@link anychart.charts.Stock#draw} is called.
|
||||
*/
|
||||
public com.anychart.core.annotations.Base startDrawing(com.anychart.core.annotations.AnnotationJSONFormat annotationTypeOrConfig) {
|
||||
return new com.anychart.core.annotations.Base(String.format(Locale.US, jsBase + ".startDrawing(%s)", (annotationTypeOrConfig != null) ? annotationTypeOrConfig.getJsBase() : null));
|
||||
}
|
||||
/**
|
||||
* Return plot annotations configuration as JSON object or string.
|
||||
*/
|
||||
public void toJson(Boolean stringify) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".toJson(%s);", stringify));
|
||||
}
|
||||
/**
|
||||
* Return plot annotations configuration as XML string or XMLNode.
|
||||
*/
|
||||
public void toXml(Boolean asXmlNode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".toXml(%s);", asXmlNode));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Trend Channel annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.TrendChannel trendChannel(String settings) {
|
||||
return new com.anychart.core.annotations.TrendChannel(String.format(Locale.US, jsBase + ".trendChannel(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Triangle annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.Triangle triangle(String settings) {
|
||||
return new com.anychart.core.annotations.Triangle(String.format(Locale.US, jsBase + ".triangle(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Unselects annotations.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController unselect() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".unselect();");
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Creates and returns a Vertical Line annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine verticalLine(String settings) {
|
||||
return new com.anychart.core.annotations.VerticalLine(String.format(Locale.US, jsBase + ".verticalLine(%s)", wrapQuotes(settings)));
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.PlotController parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+1191
File diff suppressed because it is too large
Load Diff
+1211
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+970
@@ -0,0 +1,970 @@
|
||||
package com.anychart.core.annotations;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.annotations.Base;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Vertical Line annotation.
|
||||
*/
|
||||
public class VerticalLine extends Base {
|
||||
|
||||
protected VerticalLine() {
|
||||
|
||||
}
|
||||
|
||||
public static VerticalLine instantiate() {
|
||||
return new VerticalLine("new anychart.core.annotations.verticalLine()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public VerticalLine(String jsChart) {
|
||||
jsBase = "verticalLine" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for an interactivity in the annotation.
|
||||
*/
|
||||
public void allowEdit() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".allowEdit();");
|
||||
}
|
||||
/**
|
||||
* Setter for an interactivity in the annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine allowEdit(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".allowEdit(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the annotation color.
|
||||
*/
|
||||
public void color() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".color();");
|
||||
}
|
||||
/**
|
||||
* Setter for the annotation color.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine color(String color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".color(%s);", wrapQuotes(color)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns the chart on which the annotation is drawn.
|
||||
*/
|
||||
public com.anychart.core.SeparateChart getChart() {
|
||||
return new com.anychart.core.SeparateChart(jsBase + ".getChart()");
|
||||
}
|
||||
/**
|
||||
* Returns the plot on which the annotation is drawn.
|
||||
*/
|
||||
public com.anychart.core.stock.Plot getPlot() {
|
||||
return new com.anychart.core.stock.Plot(jsBase + ".getPlot()");
|
||||
}
|
||||
/**
|
||||
* Returns annotation type.
|
||||
*/
|
||||
public void getType() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".getType();");
|
||||
}
|
||||
/**
|
||||
* Getter for the hover gap.
|
||||
*/
|
||||
public void hoverGap() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".hoverGap();");
|
||||
}
|
||||
/**
|
||||
* Setter for the hover gap.<br/>
|
||||
The contour size around annotation.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine hoverGap(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hoverGap(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for hovered state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings hovered() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".hovered()");
|
||||
}
|
||||
/**
|
||||
* Setter for hovered state settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine hovered(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hovered(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for data markers.
|
||||
*/
|
||||
public com.anychart.core.ui.MarkersFactory markers() {
|
||||
return new com.anychart.core.ui.MarkersFactory(jsBase + ".markers()");
|
||||
}
|
||||
/**
|
||||
* Setter for data markers.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine markers(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".markers(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for data markers.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine markers(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".markers(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for normal state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings normal() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".normal()");
|
||||
}
|
||||
/**
|
||||
* Setter for normal state settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine normal(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".normal(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Selects current annotation.
|
||||
*/
|
||||
public void select() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".select();");
|
||||
}
|
||||
/**
|
||||
* Getter for selected state settings.
|
||||
*/
|
||||
public com.anychart.core.StateSettings selected() {
|
||||
return new com.anychart.core.StateSettings(jsBase + ".selected()");
|
||||
}
|
||||
/**
|
||||
* Setter for selected state settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine selected(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".selected(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for annotation stroke settings.
|
||||
*/
|
||||
public void stroke() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".stroke();");
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(String color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(String color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(String color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(String color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for annotation stroke settings using an object.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine stroke(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the X anchor.
|
||||
*/
|
||||
public void xAnchor() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".xAnchor();");
|
||||
}
|
||||
/**
|
||||
* Setter for the X anchor.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine xAnchor(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xAnchor(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the X-scale.
|
||||
*/
|
||||
public com.anychart.scales.Ordinal xScale() {
|
||||
return new com.anychart.scales.Ordinal(jsBase + ".xScale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine xScale(com.anychart.scales.Base settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine xScale(com.anychart.scales.StockScatterDateTime settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine xScale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the X-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine xScale(com.anychart.enums.ScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".xScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.scales.Base yScale() {
|
||||
return new com.anychart.scales.Base(jsBase + ".yScale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine yScale(com.anychart.scales.Base settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".yScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine yScale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".yScale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the Y-scale.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine yScale(com.anychart.enums.ScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".yScale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element bottom bound settings.
|
||||
*/
|
||||
public void bottom() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".bottom();");
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bottom(Number bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", bottom));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bottom bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bottom(String bottom) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", wrapQuotes(bottom)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.utils.Bounds bounds() {
|
||||
return new com.anychart.core.utils.Bounds(jsBase + ".bounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(com.anychart.utils.RectObj bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for bounds of the element using one parameter.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(com.anychart.core.utils.Bounds bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(Number x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(Number x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(Number x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(Number x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(Number x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(Number x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(Number x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(Number x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", x, wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(String x, Number y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(String x, Number y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(String x, Number y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(String x, Number y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), y, wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(String x, String y, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(String x, String y, Number width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), width, wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(String x, String y, String width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element bounds settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine bounds(String x, String y, String width, String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bounds(%s, %s, %s, %s);", wrapQuotes(x), wrapQuotes(y), wrapQuotes(width), wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns pixel bounds of the element due to parent bounds and self bounds settings.
|
||||
*/
|
||||
public com.anychart.math.Rect getPixelBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getPixelBounds()");
|
||||
}
|
||||
/**
|
||||
* Getter for element height settings.
|
||||
*/
|
||||
public void height() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".height();");
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine height(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element height setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine height(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".height(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element left bound settings.
|
||||
*/
|
||||
public void left() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".left();");
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine left(Number left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", left));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element left bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine left(String left) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", wrapQuotes(left)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum height.
|
||||
*/
|
||||
public void maxHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine maxHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine maxHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the maximum width.
|
||||
*/
|
||||
public void maxWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".maxWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine maxWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the maximum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine maxWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".maxWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum height.
|
||||
*/
|
||||
public void minHeight() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minHeight();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine minHeight(Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum height.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine minHeight(String height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minHeight(%s);", wrapQuotes(height)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the minimum width.
|
||||
*/
|
||||
public void minWidth() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".minWidth();");
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine minWidth(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the minimum width.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine minWidth(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minWidth(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for element right bound settings.
|
||||
*/
|
||||
public void right() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".right();");
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine right(Number right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", right));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element right bound setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine right(String right) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", wrapQuotes(right)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for element top bound settings.
|
||||
*/
|
||||
public void top() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".top();");
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine top(Number top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", top));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element top bound settings.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine top(String top) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", wrapQuotes(top)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for element width settings.
|
||||
*/
|
||||
public void width() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".width();");
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine width(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for element width setting.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine width(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.annotations.VerticalLine parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Object xScale(Class scaleClass) {
|
||||
Object instance = null;
|
||||
try {
|
||||
instance = scaleClass.getDeclaredConstructor(String.class).newInstance(jsBase + ".xScale()");
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.lang.reflect.InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Object yScale(Class scaleClass) {
|
||||
Object instance = null;
|
||||
try {
|
||||
instance = scaleClass.getDeclaredConstructor(String.class).newInstance(jsBase + ".yScale()");
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.lang.reflect.InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,625 @@
|
||||
package com.anychart.core.axes;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBase;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Circular axis class.
|
||||
{docs:Gauges/Circular_Gauge#axis}Learn more about circular axis.{docs}
|
||||
*/
|
||||
public class Circular extends VisualBase {
|
||||
|
||||
protected Circular() {
|
||||
|
||||
}
|
||||
|
||||
public static Circular instantiate() {
|
||||
return new Circular("new anychart.core.axes.circular()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Circular(String jsChart) {
|
||||
jsBase = "circular" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for the rounding of corners.
|
||||
*/
|
||||
public void cornersRounding() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".cornersRounding();");
|
||||
}
|
||||
/**
|
||||
* Setter for the rounding of corners.
|
||||
Round off the ends of axes to the specified radius.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular cornersRounding(Number value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".cornersRounding(%s);", value));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the rounding of corners.
|
||||
Round off the ends of axes to the specified radius.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular cornersRounding(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".cornersRounding(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the first label drawing flag.
|
||||
*/
|
||||
public void drawFirstLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawFirstLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the first label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular drawFirstLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawFirstLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the last label drawing flag.
|
||||
*/
|
||||
public void drawLastLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawLastLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the last label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular drawLastLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawLastLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the axis fill color.
|
||||
*/
|
||||
public void fill() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fill();");
|
||||
}
|
||||
/**
|
||||
* Setter for axis fill settings using an array, an object or a string.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(com.anychart.graphics.vector.Fill color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s);", (color != null) ? color.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis fill settings using an array, an object or a string.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(com.anychart.graphics.vector.GradientKey color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s);", (color != null) ? color.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis fill settings using an array, an object or a string.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(String[] color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s);", arrayToStringWrapQuotes(color)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Axis fill color with opacity. Fill as a string or an object.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(String color, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s);", wrapQuotes(color), opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient axis fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(com.anychart.graphics.vector.GradientKey keys, Number angle, Boolean mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", (keys != null) ? keys.getJsBase() : null, angle, mode, opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient axis fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(com.anychart.graphics.vector.GradientKey keys, Number angle, com.anychart.graphics.vector.Rect mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", (keys != null) ? keys.getJsBase() : null, angle, (mode != null) ? mode.getJsBase() : null, opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient axis fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(com.anychart.graphics.vector.GradientKey keys, Number angle, String mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", (keys != null) ? keys.getJsBase() : null, angle, wrapQuotes(mode), opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient axis fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(String[] keys, Number angle, Boolean mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", arrayToStringWrapQuotes(keys), angle, mode, opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient axis fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(String[] keys, Number angle, com.anychart.graphics.vector.Rect mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", arrayToStringWrapQuotes(keys), angle, (mode != null) ? mode.getJsBase() : null, opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient axis fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(String[] keys, Number angle, String mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", arrayToStringWrapQuotes(keys), angle, wrapQuotes(mode), opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Radial axis fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(com.anychart.graphics.vector.GradientKey keys, Number cx, Number cy, com.anychart.graphics.math.Rect mode, Number opacity, Number fx, Number fy) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s, %s, %s, %s);", (keys != null) ? keys.getJsBase() : null, cx, cy, (mode != null) ? mode.getJsBase() : null, opacity, fx, fy));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Radial axis fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(String[] keys, Number cx, Number cy, com.anychart.graphics.math.Rect mode, Number opacity, Number fx, Number fy) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s, %s, %s, %s);", arrayToStringWrapQuotes(keys), cx, cy, (mode != null) ? mode.getJsBase() : null, opacity, fx, fy));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory labels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".labels()");
|
||||
}
|
||||
/**
|
||||
* Setter for labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular labels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular labels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for minor labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory minorLabels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".minorLabels()");
|
||||
}
|
||||
/**
|
||||
* Setter for minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular minorLabels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular minorLabels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks minorTicks() {
|
||||
return new com.anychart.core.axes.CircularTicks(jsBase + ".minorTicks()");
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular minorTicks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular minorTicks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for labels overlap mode.
|
||||
*/
|
||||
public void overlapMode() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".overlapMode();");
|
||||
}
|
||||
/**
|
||||
* Setter for labels overlap mode.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular overlapMode(com.anychart.enums.LabelsOverlapMode value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", (value != null) ? value.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for labels overlap mode.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular overlapMode(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for labels overlap mode.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular overlapMode(Boolean value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", value));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Getter for the axis radius.
|
||||
*/
|
||||
public void radius() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".radius();");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis radius.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular radius(Number value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".radius(%s);", value));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis radius.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular radius(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".radius(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for the axis scale.
|
||||
*/
|
||||
public com.anychart.scales.Linear scale() {
|
||||
return new com.anychart.scales.Linear(jsBase + ".scale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis scale.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular scale(com.anychart.enums.GaugeScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis scale.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular scale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis scale.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular scale(com.anychart.scales.Linear settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the start angle.
|
||||
*/
|
||||
public void startAngle() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".startAngle();");
|
||||
}
|
||||
/**
|
||||
* Setter for the start angle.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular startAngle(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".startAngle(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the start angle.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular startAngle(Number value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".startAngle(%s);", value));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the sweep angle.
|
||||
*/
|
||||
public void sweepAngle() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".sweepAngle();");
|
||||
}
|
||||
/**
|
||||
* Setter for the sweep angle.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular sweepAngle(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".sweepAngle(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the sweep angle.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular sweepAngle(Number value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".sweepAngle(%s);", value));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for circular ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks ticks() {
|
||||
return new com.anychart.core.axes.CircularTicks(jsBase + ".ticks()");
|
||||
}
|
||||
/**
|
||||
* Setter for circular ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular ticks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for circular ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular ticks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the axis width.
|
||||
*/
|
||||
public void width() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".width();");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis width.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular width(Number value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", value));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis width.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular width(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Circular parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public com.anychart.core.axes.Circular fill(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,548 @@
|
||||
package com.anychart.core.axes;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBase;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Axis ticks class.
|
||||
*/
|
||||
public class CircularTicks extends VisualBase {
|
||||
|
||||
protected CircularTicks() {
|
||||
|
||||
}
|
||||
|
||||
public static CircularTicks instantiate() {
|
||||
return new CircularTicks("new anychart.core.axes.circularTicks()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public CircularTicks(String jsChart) {
|
||||
jsBase = "circularTicks" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for ticks fill color.
|
||||
*/
|
||||
public void fill() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".fill();");
|
||||
}
|
||||
/**
|
||||
* Setter for ticks fill settings using an array, an object or a string.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(com.anychart.graphics.vector.Fill color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s);", (color != null) ? color.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks fill settings using an array, an object or a string.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(com.anychart.graphics.vector.GradientKey color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s);", (color != null) ? color.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks fill settings using an array, an object or a string.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(String[] color) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s);", arrayToStringWrapQuotes(color)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Ticks fill color with opacity. Fill as a string or an object.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(String color, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s);", wrapQuotes(color), opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(com.anychart.graphics.vector.GradientKey keys, Number angle, Boolean mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", (keys != null) ? keys.getJsBase() : null, angle, mode, opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(com.anychart.graphics.vector.GradientKey keys, Number angle, com.anychart.graphics.vector.Rect mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", (keys != null) ? keys.getJsBase() : null, angle, (mode != null) ? mode.getJsBase() : null, opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(com.anychart.graphics.vector.GradientKey keys, Number angle, String mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", (keys != null) ? keys.getJsBase() : null, angle, wrapQuotes(mode), opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(String[] keys, Number angle, Boolean mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", arrayToStringWrapQuotes(keys), angle, mode, opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(String[] keys, Number angle, com.anychart.graphics.vector.Rect mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", arrayToStringWrapQuotes(keys), angle, (mode != null) ? mode.getJsBase() : null, opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Linear gradient fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(String[] keys, Number angle, String mode, Number opacity) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s);", arrayToStringWrapQuotes(keys), angle, wrapQuotes(mode), opacity));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Radial gradient fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(com.anychart.graphics.vector.GradientKey keys, Number cx, Number cy, com.anychart.graphics.math.Rect mode, Number opacity, Number fx, Number fy) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s, %s, %s, %s);", (keys != null) ? keys.getJsBase() : null, cx, cy, (mode != null) ? mode.getJsBase() : null, opacity, fx, fy));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Radial gradient fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(String[] keys, Number cx, Number cy, com.anychart.graphics.math.Rect mode, Number opacity, Number fx, Number fy) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s, %s, %s, %s, %s, %s, %s);", arrayToStringWrapQuotes(keys), cx, cy, (mode != null) ? mode.getJsBase() : null, opacity, fx, fy));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for ticks hatch fill settings.
|
||||
*/
|
||||
public com.anychart.graphics.vector.PatternFill hatchFill() {
|
||||
return new com.anychart.graphics.vector.PatternFill(jsBase + ".hatchFill()");
|
||||
}
|
||||
/**
|
||||
* Setter for ticks hatch fill settings.
|
||||
{docs:Graphics/Hatch_Fill_Settings}Learn more about hatch fill settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks hatchFill(com.anychart.graphics.vector.hatchfill.HatchFillType type, String color, Number thickness, Number size) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hatchFill(%s, %s, %s, %s);", (type != null) ? type.getJsBase() : null, wrapQuotes(color), thickness, size));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks hatch fill settings.
|
||||
{docs:Graphics/Hatch_Fill_Settings}Learn more about hatch fill settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks hatchFill(String type, String color, Number thickness, Number size) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hatchFill(%s, %s, %s, %s);", wrapQuotes(type), wrapQuotes(color), thickness, size));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for hatch fill settings using function.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks hatchFill(String hatchFillFunction) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hatchFill(%s);", wrapQuotes(hatchFillFunction)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for hatch fill settings using pattern fill.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks hatchFill(com.anychart.graphics.vector.PatternFill patternFill) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hatchFill(%s);", (patternFill != null) ? patternFill.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for hatch fill settings using an instance.
|
||||
{docs:Graphics/Fill_Settings}Learn more about coloring.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks hatchFill(com.anychart.graphics.vector.HatchFill settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hatchFill(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for hatch fill using boolean.
|
||||
{docs:Graphics/Hatch_Fill_Settings}Learn more about hatch fill settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks hatchFill(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".hatchFill(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for ticks length.
|
||||
*/
|
||||
public void length() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".length();");
|
||||
}
|
||||
/**
|
||||
* Setter for ticks length.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks length(Number length) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".length(%s);", length));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks length.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks length(String length) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".length(%s);", wrapQuotes(length)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for ticks position.
|
||||
*/
|
||||
public void position() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".position();");
|
||||
}
|
||||
/**
|
||||
* Setter for ticks position.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks position(com.anychart.enums.SidePosition value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".position(%s);", (value != null) ? value.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks position.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks position(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".position(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for ticks stroke.
|
||||
*/
|
||||
public void stroke() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".stroke();");
|
||||
}
|
||||
/**
|
||||
* Setter for ticks stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks stroke(String color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks stroke(String color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks stroke(String color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks stroke(String color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks stroke settings using an object.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks stroke(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for ticks type.
|
||||
*/
|
||||
public void type() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".type();");
|
||||
}
|
||||
/**
|
||||
* Setter for ticks type.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks type(com.anychart.enums.MarkerType type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".type(%s);", (type != null) ? type.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for ticks type.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks type(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".type(%s);", wrapQuotes(type)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public com.anychart.core.axes.CircularTicks fill(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".fill(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,634 @@
|
||||
package com.anychart.core.axes;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBase;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Linear axis class.<br/>
|
||||
Any axis must be bound to a scale.<br/>
|
||||
To obtain a new instance of Axis use {@link anychart.standalones.axes#linear}.
|
||||
*/
|
||||
public class Linear extends VisualBase {
|
||||
|
||||
protected Linear() {
|
||||
|
||||
}
|
||||
|
||||
public static Linear instantiate() {
|
||||
return new Linear("new anychart.core.axes.linear()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Linear(String jsChart) {
|
||||
jsBase = "linear" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for the first label drawing flag.
|
||||
*/
|
||||
public void drawFirstLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawFirstLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the first label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear drawFirstLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawFirstLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the last label drawing flag.
|
||||
*/
|
||||
public void drawLastLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawLastLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the last label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear drawLastLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawLastLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns pixel bounds of the axis.
|
||||
*/
|
||||
public com.anychart.math.Rect getPixelBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getPixelBounds()");
|
||||
}
|
||||
/**
|
||||
* Returns remaining parent bounds to use elsewhere.
|
||||
*/
|
||||
public com.anychart.math.Rect getRemainingBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getRemainingBounds()");
|
||||
}
|
||||
/**
|
||||
* Whether an axis is horizontal.
|
||||
*/
|
||||
public void isHorizontal() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".isHorizontal();");
|
||||
}
|
||||
/**
|
||||
* Getter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory labels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".labels()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear labels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear labels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory minorLabels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".minorLabels()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear minorLabels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear minorLabels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Ticks minorTicks() {
|
||||
return new com.anychart.core.axes.Ticks(jsBase + ".minorTicks()");
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear minorTicks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear minorTicks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the axis orientation.
|
||||
*/
|
||||
public void orientation() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".orientation();");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis orientation.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear orientation(com.anychart.enums.Orientation orientation) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".orientation(%s);", (orientation != null) ? orientation.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis orientation.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear orientation(String orientation) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".orientation(%s);", wrapQuotes(orientation)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for labels overlap mode.
|
||||
*/
|
||||
public void overlapMode() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".overlapMode();");
|
||||
}
|
||||
/**
|
||||
* Setter for labels overlap mode.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear overlapMode(com.anychart.enums.LabelsOverlapMode mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", (mode != null) ? mode.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for labels overlap mode.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear overlapMode(String mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", wrapQuotes(mode)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for the axis scale.
|
||||
*/
|
||||
public com.anychart.scales.Base scale() {
|
||||
return new com.anychart.scales.Base(jsBase + ".scale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis scale.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear scale(com.anychart.scales.Base settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis scale.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear scale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis scale.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear scale(com.anychart.enums.ScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for stagger lines.
|
||||
*/
|
||||
public void staggerLines() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".staggerLines();");
|
||||
}
|
||||
/**
|
||||
* Setter for stagger lines.<br/>
|
||||
<b>Note:</b> pass <b>null</b> to enable autocalculation.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear staggerLines(Number count) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".staggerLines(%s);", count));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for maximum stagger lines.
|
||||
*/
|
||||
public void staggerMaxLines() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".staggerMaxLines();");
|
||||
}
|
||||
/**
|
||||
* Setter for maximum stagger lines in autocalculation mode (if {@link anychart.core.axes.Linear#staggerLines} passed null).
|
||||
*/
|
||||
public com.anychart.core.axes.Linear staggerMaxLines(Number count) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".staggerMaxLines(%s);", count));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the stagger mode state.
|
||||
*/
|
||||
public void staggerMode() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".staggerMode();");
|
||||
}
|
||||
/**
|
||||
* Setter for the stagger mode state.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear staggerMode(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".staggerMode(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis stroke settings.
|
||||
*/
|
||||
public void stroke() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".stroke();");
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(String value, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(String value, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(String value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(String value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings using an object.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear stroke(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Ticks ticks() {
|
||||
return new com.anychart.core.axes.Ticks(jsBase + ".ticks()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear ticks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear ticks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.ui.Title title() {
|
||||
return new com.anychart.core.ui.Title(jsBase + ".title()");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear title(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".title(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear title(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".title(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the axis width.
|
||||
*/
|
||||
public void width() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".width();");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis width.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear width(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis width.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear width(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Linear parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,648 @@
|
||||
package com.anychart.core.axes;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.axes.Linear;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Linear Gauge axis class.<br/>
|
||||
Any axis must be bound to a scale.<br/>
|
||||
To obtain a new instance of Axis use {@link anychart.standalones.axes#linear}.
|
||||
*/
|
||||
public class LinearGauge extends Linear {
|
||||
|
||||
protected LinearGauge() {
|
||||
|
||||
}
|
||||
|
||||
public static LinearGauge instantiate() {
|
||||
return new LinearGauge("new anychart.core.axes.linearGauge()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public LinearGauge(String jsChart) {
|
||||
jsBase = "linearGauge" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for the first label drawing flag.
|
||||
*/
|
||||
public void drawFirstLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawFirstLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the first label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge drawFirstLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawFirstLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the last label drawing flag.
|
||||
*/
|
||||
public void drawLastLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawLastLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the last label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge drawLastLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawLastLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns remaining parent bounds to use elsewhere.
|
||||
*/
|
||||
public com.anychart.math.Rect getRemainingBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getRemainingBounds()");
|
||||
}
|
||||
/**
|
||||
* Whether an axis is horizontal.
|
||||
*/
|
||||
public void isHorizontal() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".isHorizontal();");
|
||||
}
|
||||
/**
|
||||
* Getter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory labels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".labels()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge labels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge labels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory minorLabels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".minorLabels()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge minorLabels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge minorLabels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Ticks minorTicks() {
|
||||
return new com.anychart.core.axes.Ticks(jsBase + ".minorTicks()");
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge minorTicks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge minorTicks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the axis offset.
|
||||
*/
|
||||
public void offset() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".offset();");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis offset.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge offset(String offset) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".offset(%s);", wrapQuotes(offset)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the axis orientation.
|
||||
*/
|
||||
public void orientation() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".orientation();");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis orientation.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge orientation(com.anychart.enums.Orientation orientation) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".orientation(%s);", (orientation != null) ? orientation.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis orientation.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge orientation(String orientation) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".orientation(%s);", wrapQuotes(orientation)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for labels overlap mode.
|
||||
*/
|
||||
public void overlapMode() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".overlapMode();");
|
||||
}
|
||||
/**
|
||||
* Setter for labels overlap mode.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge overlapMode(com.anychart.enums.LabelsOverlapMode mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", (mode != null) ? mode.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for labels overlap mode.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge overlapMode(String mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", wrapQuotes(mode)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for the axis scale.
|
||||
*/
|
||||
public com.anychart.scales.Base scale() {
|
||||
return new com.anychart.scales.Base(jsBase + ".scale()");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis scale.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge scale(com.anychart.scales.Base settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis scale.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge scale(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scale(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis scale.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge scale(com.anychart.enums.ScaleTypes settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".scale(%s);", (settings != null) ? settings.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for stagger lines.
|
||||
*/
|
||||
public void staggerLines() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".staggerLines();");
|
||||
}
|
||||
/**
|
||||
* Setter for stagger lines.<br/>
|
||||
<b>Note:</b> pass <b>null</b> to enable autocalculation.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge staggerLines(Number count) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".staggerLines(%s);", count));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for maximum stagger lines.
|
||||
*/
|
||||
public void staggerMaxLines() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".staggerMaxLines();");
|
||||
}
|
||||
/**
|
||||
* Setter for maximum stagger lines in autocalculation mode (if {@link anychart.core.axes.Linear#staggerLines} passed null).
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge staggerMaxLines(Number count) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".staggerMaxLines(%s);", count));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the stagger mode state.
|
||||
*/
|
||||
public void staggerMode() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".staggerMode();");
|
||||
}
|
||||
/**
|
||||
* Setter for the stagger mode state.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge staggerMode(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".staggerMode(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis stroke settings.
|
||||
*/
|
||||
public void stroke() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".stroke();");
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(String value, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(String value, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(String value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(String value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings using an object.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge stroke(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Ticks ticks() {
|
||||
return new com.anychart.core.axes.Ticks(jsBase + ".ticks()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge ticks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge ticks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.ui.Title title() {
|
||||
return new com.anychart.core.ui.Title(jsBase + ".title()");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge title(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".title(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge title(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".title(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the axis width.
|
||||
*/
|
||||
public void width() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".width();");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis width.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge width(Number width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", width));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis width.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge width(String width) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".width(%s);", wrapQuotes(width)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Returns pixel bounds of the axis.
|
||||
*/
|
||||
public com.anychart.math.Rect getPixelBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".getPixelBounds()");
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.LinearGauge parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,497 @@
|
||||
package com.anychart.core.axes;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBase;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Map axis class.
|
||||
*/
|
||||
public class Map extends VisualBase {
|
||||
|
||||
protected Map() {
|
||||
|
||||
}
|
||||
|
||||
public static Map instantiate() {
|
||||
return new Map("new anychart.core.axes.map()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Map(String jsChart) {
|
||||
jsBase = "map" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for the first label drawing flag.
|
||||
*/
|
||||
public void drawFirstLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawFirstLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the first label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.Map drawFirstLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawFirstLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the last label drawing flag.
|
||||
*/
|
||||
public void drawLastLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawLastLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the last label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.Map drawLastLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawLastLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the element state (enabled or disabled).
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the element enabled state.
|
||||
*/
|
||||
public com.anychart.core.axes.Map enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory labels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".labels()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Map labels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Map labels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory minorLabels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".minorLabels()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Map minorLabels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Map minorLabels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.MapTicks minorTicks() {
|
||||
return new com.anychart.core.axes.MapTicks(jsBase + ".minorTicks()");
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Map minorTicks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Map minorTicks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for labels overlap mode.
|
||||
*/
|
||||
public void overlapMode() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".overlapMode();");
|
||||
}
|
||||
/**
|
||||
* Setter for overlap mode for labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Map overlapMode(com.anychart.enums.LabelsOverlapMode value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", (value != null) ? value.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for overlap mode for labels.
|
||||
*/
|
||||
public com.anychart.core.axes.Map overlapMode(String value) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", wrapQuotes(value)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for axis stroke settings.
|
||||
*/
|
||||
public void stroke() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".stroke();");
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(com.anychart.graphics.vector.Stroke color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(com.anychart.graphics.vector.ColoredFill color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (color != null) ? color.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(String color, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(String color, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(String color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(String color, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(color), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings using an object.
|
||||
*/
|
||||
public com.anychart.core.axes.Map stroke(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.MapTicks ticks() {
|
||||
return new com.anychart.core.axes.MapTicks(jsBase + ".ticks()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Map ticks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.Map ticks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.ui.Title title() {
|
||||
return new com.anychart.core.ui.Title(jsBase + ".title()");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.axes.Map title(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".title(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.axes.Map title(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".title(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.axes.Map zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.Map container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.Map container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.Map container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Map parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Map parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Map parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.Map parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,585 @@
|
||||
package com.anychart.core.axes;
|
||||
|
||||
import com.anychart.APIlib;
|
||||
import com.anychart.chart.common.dataentry.DataEntry;
|
||||
import com.anychart.JsObject;
|
||||
import com.anychart.core.VisualBase;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
// class
|
||||
/**
|
||||
* Map axes settings class.
|
||||
*/
|
||||
public class MapSettings extends VisualBase {
|
||||
|
||||
protected MapSettings() {
|
||||
|
||||
}
|
||||
|
||||
public static MapSettings instantiate() {
|
||||
return new MapSettings("new anychart.core.axes.mapSettings()");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public MapSettings(String jsChart) {
|
||||
jsBase = "mapSettings" + ++variableIndex;
|
||||
APIlib.getInstance().addJSLine(jsBase + " = " + jsChart + ";");
|
||||
}
|
||||
|
||||
public String getJsBase() {
|
||||
return jsBase;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for the bottom axis.
|
||||
*/
|
||||
public com.anychart.core.axes.Map bottom() {
|
||||
return new com.anychart.core.axes.Map(jsBase + ".bottom()");
|
||||
}
|
||||
/**
|
||||
* Setter for the bottom axis.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings bottom(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the bottom axis.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings bottom(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".bottom(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the first label drawing flag.
|
||||
*/
|
||||
public void drawFirstLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawFirstLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the first label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings drawFirstLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawFirstLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the last label drawing flag.
|
||||
*/
|
||||
public void drawLastLabel() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".drawLastLabel();");
|
||||
}
|
||||
/**
|
||||
* Setter for the last label drawing flag.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings drawLastLabel(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".drawLastLabel(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the axis enabled state.
|
||||
*/
|
||||
public void enabled() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".enabled();");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis enabled state.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings enabled(Boolean enabled) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".enabled(%s);", enabled));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory labels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".labels()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings labels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis labels.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings labels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".labels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the left axis.
|
||||
*/
|
||||
public com.anychart.core.axes.Map left() {
|
||||
return new com.anychart.core.axes.Map(jsBase + ".left()");
|
||||
}
|
||||
/**
|
||||
* Setter for the left axis.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings left(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the left axis.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings left(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".left(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.ui.LabelsFactory minorLabels() {
|
||||
return new com.anychart.core.ui.LabelsFactory(jsBase + ".minorLabels()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings minorLabels(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis minor labels.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings minorLabels(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorLabels(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.MapTicks minorTicks() {
|
||||
return new com.anychart.core.axes.MapTicks(jsBase + ".minorTicks()");
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings minorTicks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for minor axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings minorTicks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".minorTicks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for labels overlap mode.
|
||||
*/
|
||||
public void overlapMode() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".overlapMode();");
|
||||
}
|
||||
/**
|
||||
* Setter for labels overlap mode.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings overlapMode(com.anychart.enums.LabelsOverlapMode mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", (mode != null) ? mode.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for labels overlap mode.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings overlapMode(String mode) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".overlapMode(%s);", wrapQuotes(mode)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(com.anychart.graphics.vector.PaperSize paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", (paperSizeOrOptions != null) ? paperSizeOrOptions.getJsBase() : null, landscape));
|
||||
}
|
||||
/**
|
||||
* Prints all elements on related stage.
|
||||
*/
|
||||
public void print(String paperSizeOrOptions, Boolean landscape) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".print(%s, %s);", wrapQuotes(paperSizeOrOptions), landscape));
|
||||
}
|
||||
/**
|
||||
* Removes all listeners from an object. You can also optionally remove listeners of some particular type.
|
||||
*/
|
||||
public void removeAllListeners(String type) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".removeAllListeners(%s);", wrapQuotes(type)));
|
||||
}
|
||||
/**
|
||||
* Getter for the right axis.
|
||||
*/
|
||||
public com.anychart.core.axes.Map right() {
|
||||
return new com.anychart.core.axes.Map(jsBase + ".right()");
|
||||
}
|
||||
/**
|
||||
* Setter for the right axis.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings right(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the right axis.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings right(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".right(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis stroke settings.
|
||||
*/
|
||||
public void stroke() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".stroke();");
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(com.anychart.graphics.vector.Stroke value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(com.anychart.graphics.vector.ColoredFill value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", (value != null) ? value.getJsBase() : null, thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(String value, Number thickness, String dashpattern, String lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(String value, Number thickness, String dashpattern, String lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), wrapQuotes(lineJoin), (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(String value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, String lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, wrapQuotes(lineCap)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings.
|
||||
{docs:Graphics/Stroke_Settings}Learn more about stroke settings.{docs}
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(String value, Number thickness, String dashpattern, com.anychart.graphics.vector.StrokeLineJoin lineJoin, com.anychart.graphics.vector.StrokeLineCap lineCap) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s, %s, %s, %s, %s);", wrapQuotes(value), thickness, wrapQuotes(dashpattern), (lineJoin != null) ? lineJoin.getJsBase() : null, (lineCap != null) ? lineCap.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis stroke settings using an object.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings stroke(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".stroke(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.MapTicks ticks() {
|
||||
return new com.anychart.core.axes.MapTicks(jsBase + ".ticks()");
|
||||
}
|
||||
/**
|
||||
* Setter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings ticks(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for axis ticks.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings ticks(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".ticks(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.ui.Title title() {
|
||||
return new com.anychart.core.ui.Title(jsBase + ".title()");
|
||||
}
|
||||
/**
|
||||
* Setter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings title(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".title(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the axis title.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings title(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".title(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the top axis.
|
||||
*/
|
||||
public com.anychart.core.axes.Map top() {
|
||||
return new com.anychart.core.axes.Map(jsBase + ".top()");
|
||||
}
|
||||
/**
|
||||
* Setter for the top axis.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings top(Boolean settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", settings));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the top axis.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings top(String settings) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".top(%s);", wrapQuotes(settings)));
|
||||
|
||||
return this;
|
||||
}
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(".listen('pointClick', function(e) {");
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.point.get('%1$s') + ',' +", field));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
|
||||
public void setOnClickListener(com.anychart.chart.common.listener.ListenersInterface.OnClickListener listener, String type, String ePath) {
|
||||
StringBuilder js = new StringBuilder();
|
||||
|
||||
js.append(jsBase).append(String.format(Locale.US, ".listen('%1$s', function(e) {", type));
|
||||
|
||||
if (listener.getFields() != null) {
|
||||
ePath = (ePath != null) ? ePath + "." : "";
|
||||
js.append("var result = ");
|
||||
for (String field : listener.getFields()) {
|
||||
js.append(String.format(Locale.US, "'%1$s' + ':' + e.%2$s%1$s + ',' +", field, ePath));
|
||||
}
|
||||
js.setLength(js.length() - 8);
|
||||
js.append(";");
|
||||
|
||||
js.append("android.onClick(result);");
|
||||
} else {
|
||||
js.append("android.onClick(null);");
|
||||
}
|
||||
js.append("});");
|
||||
|
||||
com.anychart.chart.common.listener.ListenersInterface.getInstance().setOnClickListener(listener);
|
||||
|
||||
APIlib.getInstance().addJSLine(js.toString());
|
||||
}
|
||||
/**
|
||||
* Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().
|
||||
*/
|
||||
public void unlistenByKey(String key) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".unlistenByKey(%s);", wrapQuotes(key)));
|
||||
}
|
||||
/**
|
||||
* Getter for the Z-index of the element.
|
||||
*/
|
||||
public void zIndex() {
|
||||
APIlib.getInstance().addJSLine(jsBase + ".zIndex();");
|
||||
}
|
||||
/**
|
||||
* Setter for the Z-index of the element.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings zIndex(Number zIndex) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".zIndex(%s);", zIndex));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the container.
|
||||
*/
|
||||
public com.anychart.graphics.vector.Layer container() {
|
||||
return new com.anychart.graphics.vector.Layer(jsBase + ".container()");
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings container(com.anychart.graphics.vector.Layer element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings container(com.anychart.graphics.vector.Stage element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", (element != null) ? element.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the container.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings container(String element) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".container(%s);", wrapQuotes(element)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Getter for the parent bounds.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.math.Rect parentBounds() {
|
||||
return new com.anychart.math.Rect(jsBase + ".parentBounds()");
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings parentBounds(com.anychart.math.Rect bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", (bounds != null) ? bounds.getJsBase() : null));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings parentBounds(String bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", wrapQuotes(bounds)));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using single value.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings parentBounds(Number bounds) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s);", bounds));
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Setter for the parent bounds using several values.<br>
|
||||
Bounds that would be used in case of percent size calculations. Expects pixel values only.
|
||||
*/
|
||||
public com.anychart.core.axes.MapSettings parentBounds(Number left, Number top, Number width, Number height) {
|
||||
APIlib.getInstance().addJSLine(String.format(Locale.US, jsBase + ".parentBounds(%s, %s, %s, %s);", left, top, width, height));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user