2024年04月24日18:28:38
备份一下代码
| | |
| | | |
| | | //Eventbus事件发布与接收 |
| | | implementation 'org.greenrobot:eventbus:3.3.1' |
| | | //屏幕适配 |
| | | //屏幕适配库 |
| | | implementation 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1' |
| | | |
| | | //图片加载库 |
| | |
| | | package com.hdl.photovoltaic; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Application; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.res.Configuration; |
| | | import android.os.SystemClock; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | |
| | | |
| | | import androidx.multidex.MultiDex; |
| | |
| | | |
| | | import cn.jpush.android.api.JPushInterface; |
| | | import io.dcloud.common.util.RuningAcitvityUtil; |
| | | import me.jessyan.autosize.AutoSizeConfig; |
| | | import me.jessyan.autosize.onAdaptListener; |
| | | import me.jessyan.autosize.utils.ScreenUtils; |
| | | import okhttp3.logging.HttpLoggingInterceptor; |
| | | |
| | | public class HDLApp extends Application { |
| | |
| | | @Override |
| | | public void onCreate() { |
| | | super.onCreate(); |
| | | |
| | | // 获取当前进程的PID |
| | | Log.d("进程===", android.os.Process.myPid() + ""); |
| | | mHDLApp = this; |
| | | SharedPreUtils.init(this); |
| | | getAppLanguage(); |
| | | initThirdSDK(); |
| | | init(); |
| | | // appLocationInfo(); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 初始化三方相关SDK |
| | | */ |
| | | public void initThirdSDK() { |
| | | public void init() { |
| | | // 小程序进程 |
| | | if (RuningAcitvityUtil.getAppName(getBaseContext()).contains(":")) { |
| | | return; |
| | |
| | | // TypeUtils.compatibleWithFieldName = true; |
| | | // //9.初始化网络工具 |
| | | // NetWorkUtil.init(this); |
| | | initAutoSize(); |
| | | //初始化极光推送 |
| | | initJPush(); |
| | | initHDLLinkPMSdk(); |
| | |
| | | SystemClock.sleep(200); |
| | | initDCUniMPSDK(); |
| | | Intent intent = new Intent(getInstance(), HomeLoginActivity.class); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); |
| | | if (type == 1) { |
| | | intent.putExtra("isJpush", true); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 蓝湖上 修改宽度 640dp 宽度按照dp、sp来适配 |
| | | * 旋转后高变宽,按旋转后高度适配,所以宽度不写死 |
| | | */ |
| | | private void initAutoSize() { |
| | | boolean isBaseOnWidth = getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT; |
| | | AutoSizeConfig.getInstance() |
| | | .setBaseOnWidth(isBaseOnWidth) |
| | | .setUseDeviceSize(false) |
| | | .setDesignWidthInDp(isBaseOnWidth ? 375 : 812) |
| | | .setDesignHeightInDp(isBaseOnWidth ? 812 : 375) |
| | | .setOnAdaptListener(new onAdaptListener() { |
| | | @Override |
| | | public void onAdaptBefore(Object target, Activity activity) { |
| | | |
| | | AutoSizeConfig.getInstance().setScreenWidth(ScreenUtils.getScreenSize(activity)[0]); |
| | | AutoSizeConfig.getInstance().setScreenHeight(ScreenUtils.getScreenSize(activity)[1] + |
| | | ScreenUtils.getHeightOfNavigationBar(activity) + ScreenUtils.getStatusBarHeight()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdaptAfter(Object target, Activity activity) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 初始化uni app mqtt |
| | |
| | | |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.utils.LocalManageUtil; |
| | | import com.jaeger.library.StatusBarUtil; |
| | | |
| | | import java.util.Locale; |
| | | |
| | |
| | | |
| | | |
| | | } |
| | | // 将StatusBar设置为透明 |
| | | public void setStatusBarTranslucent() { |
| | | StatusBarUtil.setTranslucentForImageViewInFragment(this, |
| | | 0, null); |
| | | StatusBarUtil.setLightMode(this); |
| | | } |
| | | |
| | | /** |
| | | * 修改状态栏字体颜色(黑色) |
| | |
| | | viewBinding.homeLoginPasswordEt.removeTextChangedListener(passwordTextWatcher); |
| | | } |
| | | |
| | | // 将StatusBar设置为透明 |
| | | public void setStatusBarTranslucent() { |
| | | StatusBarUtil.setTranslucentForImageViewInFragment(this, |
| | | 0, null); |
| | | StatusBarUtil.setLightMode(this); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | viewBinding.myPowerStationFcv1.setVisibility(View.GONE);//显示电站界面 |
| | | viewBinding.myMessageFcv2.setVisibility(View.GONE);//隐藏消息界面 |
| | | viewBinding.myMeFcv3.setVisibility(View.GONE);//隐藏我的界面 |
| | | viewBinding.myPowerStationBottomIl0.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.selectedpowerstation)); |
| | | viewBinding.myPowerStationBottomIl0.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.home_page_selected)); |
| | | viewBinding.myPowerStationBottomIl0.titleTv.setTextColor(getColor(R.color.text_90000000)); |
| | | viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.unselectedpowerstation)); |
| | | viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.power_station_unselected)); |
| | | viewBinding.myPowerStationBottomIl1.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | viewBinding.myMessageBottomIl2.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.message_unselected)); |
| | | viewBinding.myMessageBottomIl2.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | viewBinding.myMeBottomIl3.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.unselectedme)); |
| | | viewBinding.myMeBottomIl3.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.me_unselected)); |
| | | viewBinding.myMeBottomIl3.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | } else if (this.currentFragmentIndex == 1) { |
| | | viewBinding.myHomePageFcv0.setVisibility(View.GONE);//隐藏首页界面 |
| | | viewBinding.myPowerStationFcv1.setVisibility(View.VISIBLE);//显示电站界面 |
| | | viewBinding.myMessageFcv2.setVisibility(View.GONE);//隐藏消息界面 |
| | | viewBinding.myMeFcv3.setVisibility(View.GONE);//隐藏我的界面 |
| | | viewBinding.myPowerStationBottomIl0.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.unselectedpowerstation)); |
| | | viewBinding.myPowerStationBottomIl0.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.home_page_unselected)); |
| | | viewBinding.myPowerStationBottomIl0.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.selectedpowerstation)); |
| | | viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.power_station_selected)); |
| | | viewBinding.myPowerStationBottomIl1.titleTv.setTextColor(getColor(R.color.text_90000000)); |
| | | viewBinding.myMessageBottomIl2.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.message_unselected)); |
| | | viewBinding.myMessageBottomIl2.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | viewBinding.myMeBottomIl3.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.unselectedme)); |
| | | viewBinding.myMeBottomIl3.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.me_unselected)); |
| | | viewBinding.myMeBottomIl3.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | } else if (this.currentFragmentIndex == 2) { |
| | | viewBinding.myHomePageFcv0.setVisibility(View.GONE);//隐藏首页界面 |
| | | viewBinding.myPowerStationFcv1.setVisibility(View.GONE);//隐藏电站界面 |
| | | viewBinding.myMessageFcv2.setVisibility(View.VISIBLE);//显示消息界面 |
| | | viewBinding.myMeFcv3.setVisibility(View.GONE);//隐藏我的界面 |
| | | viewBinding.myPowerStationBottomIl0.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.unselectedpowerstation)); |
| | | viewBinding.myPowerStationBottomIl0.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.home_page_unselected)); |
| | | viewBinding.myPowerStationBottomIl0.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.unselectedpowerstation)); |
| | | viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.power_station_unselected)); |
| | | viewBinding.myPowerStationBottomIl1.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | viewBinding.myMessageBottomIl2.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.message_select)); |
| | | viewBinding.myMessageBottomIl2.titleTv.setTextColor(getColor(R.color.text_90000000)); |
| | | viewBinding.myMeBottomIl3.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.unselectedme)); |
| | | viewBinding.myMeBottomIl3.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.me_unselected)); |
| | | viewBinding.myMeBottomIl3.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | } else if (this.currentFragmentIndex == 3) { |
| | | viewBinding.myHomePageFcv0.setVisibility(View.GONE);//隐藏首页界面 |
| | | viewBinding.myPowerStationFcv1.setVisibility(View.GONE);//隐藏电站界面 |
| | | viewBinding.myMessageFcv2.setVisibility(View.GONE);//隐藏消息界面 |
| | | viewBinding.myMeFcv3.setVisibility(View.VISIBLE);//显示我的界面 |
| | | viewBinding.myPowerStationBottomIl0.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.unselectedpowerstation)); |
| | | viewBinding.myPowerStationBottomIl0.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.home_page_unselected)); |
| | | viewBinding.myPowerStationBottomIl0.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.unselectedpowerstation)); |
| | | viewBinding.myPowerStationBottomIl1.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.power_station_unselected)); |
| | | viewBinding.myPowerStationBottomIl1.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | viewBinding.myMessageBottomIl2.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.message_unselected)); |
| | | viewBinding.myMessageBottomIl2.titleTv.setTextColor(getColor(R.color.text_65000000)); |
| | | viewBinding.myMeBottomIl3.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.selectedme)); |
| | | viewBinding.myMeBottomIl3.iconIv.setImageDrawable(AppCompatResources.getDrawable(_mActivity, R.drawable.me_selected)); |
| | | viewBinding.myMeBottomIl3.titleTv.setTextColor(getColor(R.color.text_90000000)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.hdl.photovoltaic.ui.home; |
| | | |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartSymbolType; |
| | | |
| | | public class AAChartSymbolConst { |
| | | public static final String predefinedSymbol1 = AAChartSymbolType.Triangle; |
| | | public static final String predefinedSymbol2 = AAChartSymbolType.Circle; |
| | | public static final String imageSymbol = "url(https://www.highcharts.com/samples/graphics/sun.png)"; |
| | | public static final String base64Symbol = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5Si +ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVi +pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+ 1dT1gvWd+ 1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx+ 1/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb+ 16EHTh0kX/i +c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAVVJREFUeNpi/P37NwOxYM2pHtm7lw8uYmBgYGAiVtPC3RWh+88vuneT474Dv4DkcUZibJy8PG72le/nkn+zMzAaMhnNyY1clMpCjKbz/86lMLAzMMA0MTAwMOC1Ea6JgYFB9pPwncbMg6owOaY1p3pk15zqkcWnie8j63ddY18nZHmWI2eW3vzN/Jf168c3UfGuHathAXHl+7lkBnYGBtafDP8NVd3jQ8xKHiNrZMyeqPPtE/9vTgYGBgb1H4oHlHXt43ZfWfDwNzsDIwMDA4POX831RXGrg9BdxLhob63VgTurjsAUsv5k+A9jC3/g/NCdfVoQm/+ZIu3qjhnyW3XABJANMNL19cYVcPBQrZpq9eyFwCdJmIT6D8UD5cmbHXFphKccI9Mgc84vTH9goYhPE4rGELOSx0bSjsUMDAwMunJ2FQST0+/fv1Hw5BWJbehi2DBgAHTKsWmiz+rJAAAAAElFTkSuQmCC)"; |
| | | |
| | | } |
| | |
| | | package com.hdl.photovoltaic.ui.home; |
| | | |
| | | import static com.github.AAChartModel.AAChartCore.AATools.AAColor.AARgba; |
| | | |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartModel; |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AASeriesElement; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartAnimationType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartSymbolStyleType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartSymbolType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartType; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAStyle; |
| | | import com.github.AAChartModel.AAChartCore.AATools.AAColor; |
| | | import com.github.AAChartModel.AAChartCore.AATools.AAGradientColor; |
| | | import com.github.AAChartModel.AAChartCore.AATools.AALinearGradientDirection; |
| | | |
| | |
| | | public class BasicChartComposer { |
| | | public static AAChartModel configureBasicOptions() { |
| | | return new AAChartModel() |
| | | .backgroundColor("#ffffff")//#4b2b7f |
| | | .backgroundColor("#ffffff") |
| | | // .backgroundColor("#4b2b7f") |
| | | .dataLabelsEnabled(false) |
| | | .yAxisGridLineWidth(0) |
| | | .yAxisGridLineWidth(1) |
| | | .touchEventEnabled(true); |
| | | } |
| | | |
| | | public static AAChartModel configureAreaChart() { |
| | | Map<String, Object> linearGradientColor = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToBottom, |
| | | "rgba(56,196,148,0.5)",//深粉色, alpha 透明度1 |
| | | "rgba(255,255,255,0)"//热情的粉红, alpha 透明度 0.1 |
| | | );//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | AASeriesElement element1 = new AASeriesElement() |
| | | .name("Tokyo") |
| | | .data(new Object[]{7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6}); |
| | | AASeriesElement element2 = new AASeriesElement() |
| | | .name("NewYork") |
| | | .data(new Object[]{0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5}); |
| | | AASeriesElement element3 = new AASeriesElement() |
| | | .name("London") |
| | | .data(new Object[]{0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0}); |
| | | AASeriesElement element4 = new AASeriesElement() |
| | | .name("Berlin") |
| | | .data(new Object[]{3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8}); |
| | | // .colorByPoint(true) |
| | | .color(AARgba(56,196,148,1.0f))//猩红色, alpha 透明度 1 |
| | | .lineWidth(1.5) |
| | | // .borderColor(AARgba(255,255,255,1.0f)) |
| | | .fillColor(linearGradientColor) |
| | | // .fillOpacity(0.5)//区域背景透明度,设置0的话看不到区域背景 |
| | | .data(new Object[]{0, 20, 30, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6}); |
| | | // AASeriesElement element2 = new AASeriesElement() |
| | | // .name("NewYork") |
| | | // .data(new Object[]{0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5}); |
| | | // AASeriesElement element3 = new AASeriesElement() |
| | | // .name("London") |
| | | // .data(new Object[]{0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0}); |
| | | // AASeriesElement element4 = new AASeriesElement() |
| | | // .name("Berlin") |
| | | // .data(new Object[]{3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8}); |
| | | |
| | | return configureBasicOptions() |
| | | .chartType(AAChartType.Area) |
| | | .categories(new String[]{"Java","Swift","Python","Ruby", "PHP","Go","C","C#","C++"}) |
| | | .series(new AASeriesElement[]{element1, element2, element3, element4}); |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"}) |
| | | .series(new AASeriesElement[]{element1}); |
| | | } |
| | | |
| | | public static AAChartModel configureStepAreaChartAndStepLineChart() { |
| | |
| | | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" |
| | | }) |
| | | .legendEnabled(true) |
| | | .colorsTheme(new String[]{"#fe117c","#ffc069","#06caf4","#7dffc0"}) |
| | | .colorsTheme(new String[]{"#fe117c", "#ffc069", "#06caf4", "#7dffc0"}) |
| | | .animationType(AAChartAnimationType.EaseOutCubic) |
| | | .animationDuration(1200); |
| | | } |
| | | |
| | | public static AAChartModel configureAreaChartAndAreasplineChartStyle(String chartType) { |
| | | String[] colorsArr = { |
| | | AAColor.Red, |
| | | AAColor.Orange, |
| | | AAColor.Red, |
| | | AAColor.Green, |
| | | AAColor.Red, |
| | | AAColor.Blue, |
| | | AAColor.Red, |
| | | AAColor.Gray, |
| | | AAColor.DarkGray, |
| | | AAColor.LightGray, |
| | | AAColor.Magenta, |
| | | AAColor.Brown, |
| | | AAColor.Black, |
| | | }; |
| | | AAChartModel aaChartModel = configureAreaChart() |
| | | .animationType(AAChartAnimationType.EaseOutQuart) |
| | | .legendEnabled(true) |
| | | .markerRadius(6) |
| | | .markerSymbol(AAChartSymbolType.Circle) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank); |
| | | .markerRadius(0) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.Normal) |
| | | // .markerSymbol(AAChartSymbolType.Circle) |
| | | .tooltipValueSuffix("Kw.h") |
| | | // .colorsTheme(colorsArr) |
| | | .legendEnabled(false) |
| | | ; |
| | | |
| | | |
| | | if (chartType.equals(AAChartType.Areaspline)) { |
| | | Map<String, Object> gradientColorDic = AAGradientColor.linearGradient( |
New file |
| | |
| | | package com.hdl.photovoltaic.ui.home; |
| | | |
| | | import static com.github.AAChartModel.AAChartCore.AATools.AAColor.AARgba; |
| | | import static com.hdl.photovoltaic.ui.home.AAChartSymbolConst.base64Symbol; |
| | | import static com.hdl.photovoltaic.ui.home.AAChartSymbolConst.imageSymbol; |
| | | import static com.hdl.photovoltaic.ui.home.AAChartSymbolConst.predefinedSymbol1; |
| | | import static com.hdl.photovoltaic.ui.home.AAChartSymbolConst.predefinedSymbol2; |
| | | |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartModel; |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AASeriesElement; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartAlignType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartAnimationType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartFontWeightType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartStackingType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartSymbolStyleType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartSymbolType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartVerticalAlignType; |
| | | import com.github.AAChartModel.AAChartCore.AAChartEnum.AAChartZoomType; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAColumn; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AADataElement; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AADataLabels; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAHalo; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAHover; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAInactive; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAMarker; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAMarkerHover; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAMarkerStates; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AASVGAttributes; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AASelect; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAShadow; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAStates; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAStyle; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AATooltip; |
| | | import com.github.AAChartModel.AAChartCore.AAOptionsModel.AAZonesElement; |
| | | import com.github.AAChartModel.AAChartCore.AATools.AAColor; |
| | | import com.github.AAChartModel.AAChartCore.AATools.AAGradientColor; |
| | | import com.github.AAChartModel.AAChartCore.AATools.AALinearGradientDirection; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Map; |
| | | |
| | | public class CustomStyleChartComposer { |
| | | |
| | | public static AAChartModel configureColorfulChart() { |
| | | String[] colorsNameArr = { |
| | | "red", |
| | | "orange", |
| | | "yellow", |
| | | "green", |
| | | "cyan", |
| | | "blue", |
| | | "purple", |
| | | "gray", |
| | | "darkGray", |
| | | "lightGray", |
| | | "magenta", |
| | | "brown", |
| | | "black" |
| | | }; |
| | | |
| | | String[] colorsArr = { |
| | | AAColor.Red, |
| | | AAColor.Orange, |
| | | AAColor.Yellow, |
| | | AAColor.Green, |
| | | AAColor.Cyan, |
| | | AAColor.Blue, |
| | | AAColor.Purple, |
| | | AAColor.Gray, |
| | | AAColor.DarkGray, |
| | | AAColor.LightGray, |
| | | AAColor.Magenta, |
| | | AAColor.Brown, |
| | | AAColor.Black, |
| | | }; |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Bar) |
| | | .animationType(AAChartAnimationType.Bounce) |
| | | .title("Colorful Chart") |
| | | .subtitle("use AAColor to get color string") |
| | | .dataLabelsEnabled(false) |
| | | .categories(colorsNameArr) |
| | | .colorsTheme(colorsArr) |
| | | .stacking(AAChartStackingType.Percent) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo") |
| | | .data(new Object[]{ |
| | | 149.9, 171.5, 106.4, 129.2, 144.0, 176.0, 135.6, 188.5, 276.4, 214.1, 95.6, 54.4}) |
| | | .colorByPoint(true) |
| | | }); |
| | | |
| | | } |
| | | |
| | | public static AAChartModel configureColorfulGradientColorChart() { |
| | | String[] gradientColorNamesArr = { |
| | | "oceanBlue", |
| | | "sanguine", |
| | | "lusciousLime", |
| | | "purpleLake", |
| | | "freshPapaya", |
| | | "ultramarine", |
| | | "pinkSugar", |
| | | "lemonDrizzle", |
| | | "victoriaPurple", |
| | | "springGreens", |
| | | "mysticMauve", |
| | | "reflexSilver", |
| | | "newLeaf", |
| | | "cottonCandy", |
| | | "pixieDust", |
| | | "fizzyPeach", |
| | | "sweetDream", |
| | | "firebrick", |
| | | "wroughtIron", |
| | | "deepSea", |
| | | "coastalBreeze", |
| | | "eveningDelight", |
| | | "neonGlowColor", |
| | | "berrySmoothieColor" |
| | | }; |
| | | |
| | | Map[] gradientColorArr = { |
| | | AAGradientColor.OceanBlue, |
| | | AAGradientColor.Sanguine, |
| | | AAGradientColor.LusciousLime, |
| | | AAGradientColor.PurpleLake, |
| | | AAGradientColor.FreshPapaya, |
| | | AAGradientColor.Ultramarine, |
| | | AAGradientColor.PinkSugar, |
| | | AAGradientColor.LemonDrizzle, |
| | | AAGradientColor.VictoriaPurple, |
| | | AAGradientColor.SpringGreens, |
| | | AAGradientColor.MysticMauve, |
| | | AAGradientColor.ReflexSilver, |
| | | AAGradientColor.NewLeaf, |
| | | AAGradientColor.CottonCandy, |
| | | AAGradientColor.PixieDust, |
| | | AAGradientColor.FizzyPeach, |
| | | AAGradientColor.SweetDream, |
| | | AAGradientColor.Firebrick, |
| | | AAGradientColor.WroughtIron, |
| | | AAGradientColor.DeepSea, |
| | | AAGradientColor.CoastalBreeze, |
| | | AAGradientColor.EveningDelight, |
| | | AAGradientColor.NeonGlow, |
| | | AAGradientColor.BerrySmoothie |
| | | }; |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Bar) |
| | | .title("Colorful Column Chart") |
| | | .subtitle("single data array colorful column chart") |
| | | .categories(gradientColorNamesArr) |
| | | .colorsTheme(gradientColorArr) |
| | | .yAxisTitle("gradient color") |
| | | .stacking(AAChartStackingType.Percent) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo") |
| | | .data(new Object[]{ |
| | | 149.9, 171.5, 106.4, 129.2, 144.0, 176.0, 135.6, 188.5, 276.4, 214.1, 95.6, 54.4, |
| | | 149.9, 171.5, 106.4, 129.2, 144.0, 176.0, 135.6, 188.5, 276.4, 214.1, 95.6, 54.4}) |
| | | .colorByPoint(true) |
| | | }); |
| | | |
| | | } |
| | | |
| | | public static AAChartModel configureDiscontinuousDataChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .title("Discontinuous Data Chart") |
| | | .dataLabelsEnabled(true) |
| | | .tooltipEnabled(true) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo") |
| | | .data(new Object[]{6.9, 9.5, 14.5, 18.2, 21.5, null, null, null, null, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6}) |
| | | .color(AAGradientColor.DeepSea) |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | public static AAChartModel configureColorfulColumnChart() { |
| | | Object[][] stopsArr = { |
| | | {1.00, "#38C494"}, |
| | | };//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | |
| | | Map<String, Object> linearGradientColor = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToBottom, |
| | | stopsArr |
| | | ); |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .title("Colorful Column Chart") |
| | | .subtitle("single data array colorful column chart") |
| | | .colorsTheme(new String[]{"#38C494",}) |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月",}) |
| | | .xAxisLabelsEnabled(true) |
| | | .zoomType(AAChartZoomType.XY) |
| | | .legendEnabled(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | // .color(linearGradientColor) |
| | | .name("东京") |
| | | .data(new Object[]{149.9, 171.5, 106.4, 129.2, 144.0, 176.0, 135.6, 188.5, 276.4, 214.1, 95.6, 54.4, 149.9, 171.5, 106.4, 129.2, 144.0, 176.0, 135.6, 188.5, 276.4, 214.1, 95.6, 149.9, 171.5, 106.4, 129.2, 144.0, 176.0, 135.6, 188.5, 276.4, 214.1, 95.6}) |
| | | // .colorByPoint(true) |
| | | .tooltip(new AATooltip().style(new AAStyle().backgroundColor("#FFFFFF").fontSize(25))) |
| | | |
| | | }); |
| | | } |
| | | |
| | | public static AAChartModel configureNightingaleRoseChart() { |
| | | return new AAChartModel() |
| | | .title("南丁格尔玫瑰图") |
| | | .subtitle("极地图中的一种") |
| | | .yAxisTitle("cm") |
| | | .chartType(AAChartType.Column) |
| | | .xAxisVisible(false)//是否显示最外一层圆环 |
| | | .yAxisVisible(true)//是否显示中间的多个圆环 |
| | | .legendEnabled(false)//隐藏图例(底部可点按的小圆点) |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月"}) |
| | | .dataLabelsEnabled(true) |
| | | .polar(true)//极地化图形 |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("东京") |
| | | .data(new Object[]{7.0, 6.9, 9.5, 9.6, 13.9, 14.5, 18.3, 18.2, 21.5, 25.2, 26.5, 23.3}), |
| | | } |
| | | ) |
| | | ; |
| | | } |
| | | |
| | | public static AAChartModel configureChartWithShadowStyle() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Spline) |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月"}) |
| | | .markerRadius(0) |
| | | .yAxisLineWidth(0) |
| | | .yAxisGridLineWidth(0) |
| | | .legendEnabled(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo Hot") |
| | | .lineWidth(8.0) |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}) |
| | | .shadow(new AAShadow() |
| | | .offsetX(15.0) |
| | | .offsetY(15.0) |
| | | .opacity(0.2f) |
| | | .width(8.0) |
| | | .color(AAColor.Red)) |
| | | }); |
| | | } |
| | | |
| | | public static AAChartModel configureColorfulGradientAreaChart() { |
| | | Object[][] stopsArr = { |
| | | {0.00, "#febc0f"}, |
| | | {0.50, "#FF14d4"}, |
| | | {1.00, "#0bf8f5"}, |
| | | };//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | |
| | | Map<String, Object> linearGradientColor = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToLeft, |
| | | stopsArr |
| | | );//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Areaspline) |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月"}) |
| | | .markerRadius(0) |
| | | .yAxisLineWidth(0) |
| | | .yAxisGridLineWidth(0) |
| | | .legendEnabled(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo Hot") |
| | | .lineWidth(3) |
| | | .color(linearGradientColor) |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | |
| | | public static AAChartModel configureColorfulGradientSplineChart() { |
| | | Object[][] stopsArr = { |
| | | {0.00, "#febc0f"}, |
| | | {0.25, "#FF14d4"}, |
| | | {0.50, "#0bf8f5"}, |
| | | {0.75, "#F33c52"}, |
| | | {1.00, "#1904dd"}, |
| | | };//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | |
| | | Map<String, Object> linearGradientColor = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToLeft, |
| | | stopsArr |
| | | );//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Spline) |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月"}) |
| | | .markerRadius(0) |
| | | .yAxisLineWidth(0) |
| | | .yAxisGridLineWidth(0) |
| | | .legendEnabled(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo Hot") |
| | | .lineWidth(15.0) |
| | | .color(linearGradientColor) |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | |
| | | public static AAChartModel configureGradientColorAreasplineChart() { |
| | | Map<String, Object> linearGradientColor = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToBottom, |
| | | "rgba(2255,20,147,1)",//深粉色, alpha 透明度 1 |
| | | "rgba(255,105,180,0.1)"//热情的粉红, alpha 透明度 0.1 |
| | | );//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Areaspline) |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月"}) |
| | | .markerRadius(8)//marker点半径为8个像素 |
| | | .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank)//marker点为空心效果 |
| | | .markerSymbol(AAChartSymbolType.Circle)//marker点为圆形点○ |
| | | .yAxisLineWidth(0) |
| | | .yAxisGridLineWidth(0) |
| | | .legendEnabled(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo Hot") |
| | | .lineWidth(5.0) |
| | | .color(AARgba(220, 20, 60, 1.0f))//猩红色, alpha 透明度 1 |
| | | .fillColor(linearGradientColor) |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}), |
| | | } |
| | | ); |
| | | } |
| | | |
| | | |
| | | public static AAChartModel configureSpecialStyleMarkerOfSingleDataElementChart() { |
| | | Object[][] stopsArr = { |
| | | {0.00, "#febc0f"}, |
| | | {0.25, "#FF14d4"}, |
| | | {0.50, "#0bf8f5"}, |
| | | {0.75, "#F33c52"}, |
| | | {1.00, "#1904dd"}, |
| | | };//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | |
| | | Map<String, Object> gradientColorDic1 = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToRight, |
| | | stopsArr |
| | | ); |
| | | |
| | | AADataElement singleSpecialData = new AADataElement() |
| | | .marker(new AAMarker() |
| | | .radius(8)//曲线连接点半径 |
| | | .symbol(AAChartSymbolType.Circle)//曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" |
| | | .fillColor("#FFFFFF")//点的填充色(用来设置折线连接点的填充色) |
| | | .lineWidth(5)//外沿线的宽度(用来设置折线连接点的轮廓描边的宽度) |
| | | .lineColor("#FF0000")//外沿线的颜色(用来设置折线连接点的轮廓描边颜色,当值为空字符串时,默认取数据点或数据列的颜色) |
| | | ) |
| | | .y(26.5); |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Spline) |
| | | .backgroundColor("#4b2b7f") |
| | | .dataLabelsEnabled(false)//是否显示值 |
| | | .tooltipEnabled(true) |
| | | .markerRadius(0) |
| | | .xAxisVisible(false) |
| | | .yAxisVisible(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Virtual Data") |
| | | .lineWidth(6) |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, singleSpecialData, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}) |
| | | .color(gradientColorDic1) |
| | | }); |
| | | } |
| | | |
| | | public static AAChartModel configureSpecialStyleColumnOfSingleDataElementChart() { |
| | | AADataElement singleSpecialData = new AADataElement() |
| | | .color(AAGradientColor.FreshPapaya) |
| | | .y(49.5); |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .dataLabelsEnabled(false)//是否显示值 |
| | | .tooltipEnabled(false) |
| | | .markerRadius(0) |
| | | .xAxisVisible(false) |
| | | .yAxisVisible(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Virtual Data") |
| | | .lineWidth(6) |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, singleSpecialData, 5.2, 26.5, 23.3, 26.5, 13.9, 9.6}) |
| | | .color(AAGradientColor.OceanBlue) |
| | | }); |
| | | } |
| | | |
| | | public static AAChartModel configureAreaChartThreshold() { |
| | | Map<String, Object> gradientColorDic1 = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToBottom, |
| | | "rgba(30, 144, 255,1)",//DodgerBlue, alpha 透明度 1 |
| | | "rgba(30, 144, 255,0.1)"//DodgerBlue, alpha 透明度 0.1 |
| | | ); |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Area) |
| | | .yAxisGridLineWidth(0) |
| | | .categories(new String[]{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Spe", "Oct", "Nov", "Dec"}) |
| | | .dataLabelsEnabled(false)//是否显示值 |
| | | .markerRadius(8) |
| | | .markerSymbol(AAChartSymbolType.Circle) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank) |
| | | .legendEnabled(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .threshold((-200)) |
| | | .data(new Object[]{106.4, 129.2, 269.9, -100.5, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4}) |
| | | .lineWidth(6) |
| | | .color("rgba(30, 144, 255,1)") |
| | | .fillColor(gradientColorDic1) |
| | | }); |
| | | } |
| | | |
| | | //refer to online sample https://jshare.com.cn/github/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-symbol/ |
| | | public static AAChartModel customScatterChartMarkerSymbolContent() { |
| | | AASeriesElement element1 = new AASeriesElement() |
| | | .name("Predefined symbol") |
| | | .data(new Object[]{0.45, 0.43, 0.50, 0.55, 0.58, 0.62, 0.83, 0.39, 0.56, 0.67, 0.50, 0.34, 0.50, 0.67, 0.58, 0.29, 0.46, 0.23, 0.47, 0.46, 0.38, 0.56, 0.48, 0.36}) |
| | | .marker(new AAMarker() |
| | | .symbol(predefinedSymbol1)); |
| | | |
| | | AASeriesElement element2 = new AASeriesElement() |
| | | .name("Image symbol") |
| | | .data(new Object[]{0.38, 0.31, 0.32, 0.32, 0.64, 0.66, 0.86, 0.47, 0.52, 0.75, 0.52, 0.56, 0.54, 0.60, 0.46, 0.63, 0.54, 0.51, 0.58, 0.64, 0.60, 0.45, 0.36, 0.67}) |
| | | .marker(new AAMarker() |
| | | .symbol(imageSymbol)); |
| | | |
| | | AASeriesElement element3 = new AASeriesElement() |
| | | .name("Base64 symbol (*)") |
| | | .data(new Object[]{0.46, 0.32, 0.53, 0.58, 0.86, 0.68, 0.85, 0.73, 0.69, 0.71, 0.91, 0.74, 0.60, 0.50, 0.39, 0.67, 0.55, 0.49, 0.65, 0.45, 0.64, 0.47, 0.63, 0.64}) |
| | | .marker(new AAMarker() |
| | | .symbol(base64Symbol)); |
| | | |
| | | AASeriesElement element4 = new AASeriesElement() |
| | | .name("Custom symbol") |
| | | .data(new Object[]{0.60, 0.51, 0.52, 0.53, 0.64, 0.84, 0.65, 0.68, 0.63, 0.47, 0.72, 0.60, 0.65, 0.74, 0.66, 0.65, 0.71, 0.59, 0.65, 0.77, 0.52, 0.53, 0.58, 0.53}) |
| | | .marker(new AAMarker() |
| | | .symbol(predefinedSymbol2)); |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Scatter) |
| | | .yAxisMax(3.5) |
| | | .yAxisGridLineWidth(0) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .markerRadius(8) |
| | | .series(new AASeriesElement[]{element1, element2, element3, element4}); |
| | | } |
| | | |
| | | //refer to online sample https://jshare.com.cn/github/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-marker-symbol/ |
| | | public static AAChartModel customLineChartMarkerSymbolContent() { |
| | | AAChartModel aaChartModel = customScatterChartMarkerSymbolContent(); |
| | | aaChartModel.chartType = AAChartType.Line; |
| | | return aaChartModel; |
| | | } |
| | | |
| | | //三角形雷达图 |
| | | public static AAChartModel configureTriangleRadarChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Area) |
| | | .yAxisMax(15.0) |
| | | .yAxisGridLineWidth(0) |
| | | .xAxisVisible(false) |
| | | .markerRadius(0) |
| | | .polar(true)//是否极化图形 |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .data(new Object[]{15.0, 15.0, 15.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{9.0, 9.0, 9.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{6.0, 6.0, 6.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{3.0, 3.0, 3.0,}), |
| | | }); |
| | | } |
| | | |
| | | //四边形雷达图 |
| | | public static AAChartModel configureQuadrangleRadarChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Area) |
| | | .yAxisMax(15.0) |
| | | .yAxisGridLineWidth(0) |
| | | .xAxisVisible(false) |
| | | .markerRadius(0) |
| | | .polar(true)//是否极化图形 |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .data(new Object[]{15.0, 15.0, 15.0, 15.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{9.0, 9.0, 9.0, 9.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{6.0, 6.0, 6.0, 6.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{3.0, 3.0, 3.0, 3.0,}), |
| | | }); |
| | | } |
| | | |
| | | //五边形雷达图 |
| | | public static AAChartModel configurePentagonRadarChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Area) |
| | | .yAxisMax(15.0) |
| | | .yAxisGridLineWidth(0) |
| | | .xAxisVisible(false) |
| | | .markerRadius(0) |
| | | .polar(true)//是否极化图形 |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .data(new Object[]{15.0, 15.0, 15.0, 15.0, 15.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{9.0, 9.0, 9.0, 9.0, 9.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{6.0, 6.0, 6.0, 6.0, 6.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{3.0, 3.0, 3.0, 3.0, 3.0,}), |
| | | }); |
| | | } |
| | | |
| | | //六边形雷达图 |
| | | public static AAChartModel configureHexagonRadarChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Area) |
| | | .yAxisMax(15.0) |
| | | .yAxisGridLineWidth(0) |
| | | .xAxisVisible(false) |
| | | .markerRadius(0) |
| | | .polar(true)//是否极化图形 |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .data(new Object[]{15.0, 15.0, 15.0, 15.0, 15.0, 15.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{9.0, 9.0, 9.0, 9.0, 9.0, 9.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{6.0, 6.0, 6.0, 6.0, 6.0, 6.0,}), |
| | | new AASeriesElement() |
| | | .data(new Object[]{3.0, 3.0, 3.0, 3.0, 3.0, 3.0,}), |
| | | }); |
| | | } |
| | | |
| | | public static AAChartModel adjustYAxisMaxAndMinValues() { |
| | | String[] categoriesArr = { |
| | | "孤岛危机", |
| | | "使命召唤", |
| | | "荣誉勋章", |
| | | "狙击精英", |
| | | "神秘海域", |
| | | "最后生还者", |
| | | "巫师3狂猎", |
| | | "对马之魂", |
| | | "蝙蝠侠阿甘骑士", |
| | | "地狱边境", |
| | | "闪客", |
| | | "忍者之印", |
| | | }; |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Areaspline) |
| | | .legendEnabled(false) |
| | | .yAxisVisible(true) |
| | | .markerRadius(6) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank) |
| | | .zoomType(AAChartZoomType.XY) |
| | | .categories(categoriesArr) |
| | | .yAxisMin(2.0) |
| | | .yAxisMax(45.4) |
| | | .xAxisTickInterval(2) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("体重") |
| | | .color("#2494F3") |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}) |
| | | }) |
| | | ; |
| | | } |
| | | |
| | | public static AAChartModel customSpecialStyleDataLabelOfSingleDataElementChart() { |
| | | Object[][] redStopsArr = new Object[][]{ |
| | | new Object[]{0.0, AARgba(255, 0, 0, 0.6f)},//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | new Object[]{0.5, AARgba(255, 0, 0, 0.0f)}, |
| | | new Object[]{1.0, AARgba(255, 0, 0, 0.0f)} |
| | | }; |
| | | |
| | | Map<String, Object> gradientColorDic1 = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToTop, |
| | | AARgba(255, 215, 0, 0.1f), |
| | | AARgba(255, 215, 0, 0.6f) |
| | | ); |
| | | |
| | | String formatStr = |
| | | "<img src=\"https://www.highcharts.com/samples/graphics/sun.png\">" + |
| | | "<span style=\"color:#FFFFFF;font-weight:thin;font-size:25px\">{y}</span>" + |
| | | "<span style=\"color:#FFFFFF;font-weight:thin;font-size:17px\"> m</span>"; |
| | | |
| | | |
| | | AADataElement singleSpecialData = new AADataElement() |
| | | .dataLabels(new AADataLabels() |
| | | .enabled(true) |
| | | .useHTML(true) |
| | | .format(formatStr) |
| | | .style(new AAStyle() |
| | | .fontWeight(AAChartFontWeightType.Bold) |
| | | .color(AAColor.White) |
| | | .fontSize(16)) |
| | | .y((-35)) |
| | | .align(AAChartAlignType.Center) |
| | | .verticalAlign(AAChartVerticalAlignType.Top) |
| | | .overflow("none") |
| | | .crop(false) |
| | | ) |
| | | .y(26.5); |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Areaspline) |
| | | .backgroundColor("#4b2b7f") |
| | | .dataLabelsEnabled(false)//是否显示值 |
| | | .tooltipEnabled(true) |
| | | .markerRadius(0) |
| | | .xAxisVisible(false) |
| | | .yAxisVisible(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Virtual Data") |
| | | .lineWidth(6) |
| | | .color("rgba(255,215,0,1)") |
| | | .fillColor(gradientColorDic1)// gold color, alpha: 1.0 |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, singleSpecialData, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}) |
| | | }); |
| | | } |
| | | |
| | | public static AAChartModel customBarChartHoverColorAndSelectColor() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Bar) |
| | | .title("Custom Bar Chart select color") |
| | | .yAxisReversed(true) |
| | | .xAxisReversed(true) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("ElementOne") |
| | | .data(new Object[]{211, 183, 157, 133, 111, 91, 73, 57, 43, 31, 21, 13, 7, 3}) |
| | | .allowPointSelect(true) |
| | | .states( |
| | | new AAStates() |
| | | .hover(new AAHover() |
| | | .color("rgba(220,20,60,1)"))//猩红色, alpha 透明度 1 |
| | | .select(new AASelect() |
| | | .color(AAColor.Red))) |
| | | }); |
| | | } |
| | | |
| | | public static AAChartModel customChartHoverAndSelectHaloStyle() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Line) |
| | | .title("Custom Chart Hover And Select Halo Style") |
| | | .colorsTheme(new Object[]{AAColor.Red}) |
| | | .yAxisReversed(true) |
| | | .xAxisReversed(true) |
| | | .markerRadius(20) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("ElementOne") |
| | | .data(new Object[]{211, 183, 157, 133, 111, 91, 73, 57, 43, 31, 21, 13, 7, 3}) |
| | | .allowPointSelect(true) |
| | | .states( |
| | | new AAStates() |
| | | .hover(new AAHover() |
| | | .halo(new AAHalo() |
| | | .size(130) |
| | | .opacity(0.8) |
| | | .attributes(new AASVGAttributes() |
| | | .strokeWidth(50) |
| | | .fill("#00BFFF") |
| | | .stroke("#00FA9A")))) |
| | | .select(new AASelect() |
| | | .halo(new AAHalo() |
| | | .size(130) |
| | | .opacity(1.0) |
| | | .attributes(new AASVGAttributes() |
| | | .strokeWidth(150) |
| | | .fill(AARgba(138, 43, 226, 1f)) |
| | | .stroke(AARgba(30, 144, 255, 1f))))) |
| | | )}); |
| | | } |
| | | |
| | | public static AAChartModel customSplineChartMarkerStatesHoverStyle() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Areaspline) |
| | | .title("Custom Spline Chart Marker States Hover Style") |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月"}) |
| | | .markerRadius(8.0)//marker点半径为8个像素 |
| | | .yAxisLineWidth(0) |
| | | .yAxisGridLineWidth(0) |
| | | .legendEnabled(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo Hot") |
| | | .lineWidth(5.0) |
| | | .color("rgba(220,20,60,1)")//猩红色, alpha 透明度 1 |
| | | .marker(new AAMarker() |
| | | .states(new AAMarkerStates() |
| | | .hover(new AAMarkerHover() |
| | | .fillColor(AAColor.White) |
| | | .radius(40) |
| | | .lineColor(AAColor.Green) |
| | | .lineWidth(20)))) |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}), |
| | | }); |
| | | } |
| | | |
| | | //Issue: https://github.com/AAChartModel/AAChartKit/issues/948 |
| | | public static AAChartModel splineChartHoverLineWithNoChangeAndCustomMarkerStatesHoverStyle() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Spline) |
| | | .title("Spline Chart Hover Line Width No Change && Custom Marker States Hover Style") |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月"}) |
| | | .markerRadius(8.0)//marker点半径为8个像素 |
| | | .yAxisLineWidth(0) |
| | | .yAxisGridLineWidth(0) |
| | | .legendEnabled(false) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo Hot") |
| | | .lineWidth(5.0) |
| | | .color(AAColor.Red) |
| | | .states(new AAStates() |
| | | .hover(new AAHover() |
| | | .enabled(true) |
| | | //手指盘旋或选中图表时,禁止线条变粗 |
| | | .lineWidthPlus(0))) |
| | | .marker(new AAMarker() |
| | | .states(new AAMarkerStates() |
| | | .hover(new AAMarkerHover() |
| | | .fillColor(AAColor.Red)//设置手指选中点的颜色为红色 |
| | | .radius(40)))) |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}), |
| | | }); |
| | | } |
| | | |
| | | //Issue: https://github.com/AAChartModel/AAChartKit/issues/827 |
| | | public static AAChartModel customNormalStackingChartDataLabelsContentAndStyle() { |
| | | String[] categories = { |
| | | "孤岛危机", |
| | | "使命召唤", |
| | | "荣誉勋章", |
| | | "狙击精英", |
| | | "神秘海域", |
| | | "最后生还者", |
| | | "巫师3狂猎", |
| | | "对马之魂", |
| | | "死亡搁浅", |
| | | "地狱边境", |
| | | "闪客", |
| | | "忍者之印" |
| | | }; |
| | | |
| | | String[] colorsTheme = { |
| | | "#fe117c", |
| | | "#ffc069", |
| | | "#06caf4", |
| | | "#7dffc0" |
| | | }; |
| | | |
| | | AASeriesElement element1 = new AASeriesElement() |
| | | .name("2017") |
| | | .dataLabels(new AADataLabels() |
| | | .enabled(true) |
| | | .y(-10) |
| | | .format("{total} mm") |
| | | .color(AAColor.Red) |
| | | .shape("callout") |
| | | .backgroundColor(AAColor.White) |
| | | .borderColor(AAColor.Red) |
| | | .borderRadius(1) |
| | | .borderWidth(1) |
| | | ) |
| | | .data(new Object[]{7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6}); |
| | | |
| | | AASeriesElement element2 = new AASeriesElement() |
| | | .name("2018") |
| | | .data(new Object[]{0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5}); |
| | | |
| | | AASeriesElement element3 = new AASeriesElement() |
| | | .name("2019") |
| | | .data(new Object[]{0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0}); |
| | | |
| | | AASeriesElement element4 = new AASeriesElement() |
| | | .name("2020") |
| | | .data(new Object[]{3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8}); |
| | | |
| | | AASeriesElement[] series = {element1, element2, element3, element4}; |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .yAxisGridLineWidth(0) |
| | | .markerRadius(0) |
| | | .categories(categories) |
| | | .colorsTheme(colorsTheme) |
| | | .series(series); |
| | | } |
| | | |
| | | //Issue: https://github.com/AAChartModel/AAChartKit-Swift/issues/190 |
| | | //API Doc: https://api.highcharts.com.cn/highcharts#series%3Cpyramid%3E.reversed |
| | | public static AAChartModel upsideDownPyramidChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Pyramid) |
| | | .yAxisTitle("摄氏度") |
| | | .inverted(true) |
| | | .legendEnabled(true) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("2020") |
| | | .reversed(true) |
| | | .data(new Object[][]{ |
| | | {"Swift", 15654}, |
| | | {"Objective-C", 4064}, |
| | | {"JavaScript", 1987}, |
| | | {"GO", 976}, |
| | | {"Python", 846} |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | //Issue: https://github.com/AAChartModel/AAChartKit/issues/888 |
| | | public static AAChartModel doubleLayerPieChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Pie) |
| | | .title("浏览器市场占比历史对比") |
| | | .subtitle("无任何可靠依据的虚拟数据") |
| | | .dataLabelsEnabled(true)//是否直接显示扇形图数据 |
| | | .yAxisTitle("摄氏度") |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Past") |
| | | .size("40%")//尺寸大小 |
| | | .innerSize("30%")//内部圆环半径大小占比 |
| | | .borderWidth(0)//描边的宽度 |
| | | .allowPointSelect(false)//是否允许在点击数据点标记(扇形图点击选中的块发生位移) |
| | | .data(new Object[][]{ |
| | | {"Firefox Past", 3336.2}, |
| | | {"Chrome Past", 26.8}, |
| | | {"Safari Past", 88.5}, |
| | | {"Opera Past", 46.0}, |
| | | {"Others Past", 223.0}, |
| | | }), |
| | | |
| | | new AASeriesElement() |
| | | .name("Now") |
| | | .size("80%")//尺寸大小 |
| | | .innerSize("70%")//内部圆环半径大小占比 |
| | | .borderWidth(0)//描边的宽度 |
| | | .allowPointSelect(false)//是否允许在点击数据点标记(扇形图点击选中的块发生位移) |
| | | .data(new Object[][]{ |
| | | {"Firefox Now", 336.2}, |
| | | {"Chrome Now", 6926.8}, |
| | | {"Safari Now", 388.5}, |
| | | {"Opera Now", 446.0}, |
| | | {"Others Now", 223.0}, |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | //GitHub issue https://github.com/AAChartModel/AAChartKit/issues/903 |
| | | public static AAChartModel disableSomeOfLinesMouseTrackingEffect() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Line)//图表类型 |
| | | .tooltipValueSuffix("万元")//设置浮动提示框单位后缀 |
| | | .yAxisTitle("万元")//设置 Y 轴标题 |
| | | .categories(new String[]{ |
| | | "一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月" |
| | | }) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("2017") |
| | | .data(new Object[]{7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6}), |
| | | new AASeriesElement() |
| | | .name("2018") |
| | | .enableMouseTracking(false) |
| | | .data(new Object[]{0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5}), |
| | | new AASeriesElement() |
| | | .name("2019") |
| | | .enableMouseTracking(false) |
| | | .data(new Object[]{0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0}), |
| | | new AASeriesElement() |
| | | .name("2020") |
| | | .enableMouseTracking(false) |
| | | .data(new Object[]{3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8}), |
| | | }); |
| | | } |
| | | |
| | | |
| | | // GitHub issue https://github.com/AAChartModel/AAChartKit/issues/904 |
| | | public static AAChartModel configureColorfulShadowSplineChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Spline) |
| | | .yAxisVisible(false) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .colorsTheme(new String[]{"#1e90ff", "#ef476f", "#ffd066", "#04d69f"}) |
| | | .markerSymbol(AAChartSymbolType.Circle) |
| | | .markerRadius(8.0) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.BorderBlank) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("2017") |
| | | .lineWidth(5) |
| | | .data(new Object[]{0.45, 0.43, 0.50, 0.55, 0.58, 0.62, 0.83, 0.39, 0.56, 0.67, 0.50, 0.34, 0.50, 0.67, 0.58, 0.29, 0.46, 0.23, 0.47, 0.46, 0.38, 0.56, 0.48, 0.36}) |
| | | .shadow( |
| | | new AAShadow() |
| | | .offsetX(15.0) |
| | | .offsetY(15.0) |
| | | .opacity(0.2f) |
| | | .width(8.0) |
| | | .color("#1e90ff")), |
| | | new AASeriesElement() |
| | | .name("2018") |
| | | .lineWidth(5) |
| | | .data(new Object[]{0.38, 0.31, 0.32, 0.32, 0.64, 0.66, 0.86, 0.47, 0.52, 0.75, 0.52, 0.56, 0.54, 0.60, 0.46, 0.63, 0.54, 0.51, 0.58, 0.64, 0.60, 0.45, 0.36, 0.67}) |
| | | .shadow( |
| | | new AAShadow() |
| | | .offsetX(15.0) |
| | | .offsetY(15.0) |
| | | .opacity(0.2f) |
| | | .width(8.0) |
| | | .color("#ef476f")), |
| | | new AASeriesElement() |
| | | .name("2019") |
| | | .lineWidth(5) |
| | | .data(new Object[]{0.46, 0.32, 0.53, 0.58, 0.86, 0.68, 0.85, 0.73, 0.69, 0.71, 0.91, 0.74, 0.60, 0.50, 0.39, 0.67, 0.55, 0.49, 0.65, 0.45, 0.64, 0.47, 0.63, 0.64}) |
| | | .shadow( |
| | | new AAShadow() |
| | | .offsetX(15.0) |
| | | .offsetY(15.0) |
| | | .opacity(0.2f) |
| | | .width(8.0) |
| | | .color("#ffd066")), |
| | | new AASeriesElement() |
| | | .name("2020") |
| | | .lineWidth(5) |
| | | .data(new Object[]{0.60, 0.51, 0.52, 0.53, 0.64, 0.84, 0.65, 0.68, 0.63, 0.47, 0.72, 0.60, 0.65, 0.74, 0.66, 0.65, 0.71, 0.59, 0.65, 0.77, 0.52, 0.53, 0.58, 0.53}) |
| | | .shadow( |
| | | new AAShadow() |
| | | .offsetX(15.0) |
| | | .offsetY(15.0) |
| | | .opacity(0.2f) |
| | | .width(8.0) |
| | | .color("#04d69f")), |
| | | }); |
| | | } |
| | | |
| | | // GitHub issue https://github.com/AAChartModel/AAChartKit/issues/905 |
| | | public static AAChartModel configureColorfulDataLabelsStepLineChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Line) |
| | | .yAxisVisible(false) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .colorsTheme(new String[]{"#1e90ff", "#ef476f", "#ffd066", "#04d69f"}) |
| | | .markerSymbol(AAChartSymbolType.Circle) |
| | | .markerRadius(8.0) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("2017") |
| | | .step((true)) |
| | | .dataLabels(new AADataLabels() |
| | | .style(new AAStyle() |
| | | .color("#1e90ff") |
| | | .fontSize(11))) |
| | | .data(new Object[]{2.10, 2.54, 2.78, 3.62, 4.41, 4.09, 3.83, 4.47, 4.20, 3.94, 3.80, 3.58, 3.19, 4.30, 3.69, 3.52, 3.02, 3.30}), |
| | | new AASeriesElement() |
| | | .name("2018") |
| | | .step((true)) |
| | | .dataLabels(new AADataLabels() |
| | | .style(new AAStyle() |
| | | .color("#ef476f") |
| | | .fontSize(11))) |
| | | .data(new Object[]{1.56, 1.91, 2.45, 3.87, 3.24, 4.90, 4.61, 4.10, 4.17, 3.85, 4.17, 3.46, 3.46, 3.55, 3.50, 4.13, 2.58, 2.28}), |
| | | new AASeriesElement() |
| | | .name("2019") |
| | | .step((true)) |
| | | .dataLabels(new AADataLabels() |
| | | .style(new AAStyle() |
| | | .color("#ffd066") |
| | | .fontSize(11))) |
| | | .data(new Object[]{1.16, 1.67, 2.64, 2.86, 3.00, 3.21, 4.14, 4.07, 3.68, 3.11, 3.41, 3.25, 3.32, 3.07, 3.92, 3.05, 2.18, 3.24}), |
| | | new AASeriesElement() |
| | | .name("2020") |
| | | .step((true)) |
| | | .dataLabels(new AADataLabels() |
| | | .style(new AAStyle() |
| | | .color("#04d69f") |
| | | .fontSize(11))) |
| | | .data(new Object[]{5.59, 3.09, 4.09, 6.14, 5.33, 6.05, 5.71, 6.22, 6.56, 4.75, 5.27, 6.02, 5.22, 5.77, 6.19, 5.68, 4.33, 5.48}), |
| | | }); |
| | | } |
| | | |
| | | |
| | | // GitHub issue https://github.com/AAChartModel/AAChartKit-Swift/issues/223 |
| | | public static AAChartModel configureColorfulGradientColorAndColorfulDataLabelsStepAreaChart() { |
| | | Object[][] blueStopsArr = new Object[][]{ |
| | | {0.0, AARgba(30, 144, 255, 1.0f)},//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | {0.5, AARgba(30, 144, 255, 0.2f)}, |
| | | {1.0, AARgba(30, 144, 255, 0.0f)} |
| | | }; |
| | | Map<String, Object> gradientBlueColorDic = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToBottom, |
| | | blueStopsArr |
| | | ); |
| | | |
| | | Object[][] redStopsArr = new Object[][]{ |
| | | {0.0, AARgba(255, 0, 0, 1.0f)},//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | {0.5, AARgba(255, 0, 0, 0.2f)}, |
| | | {1.0, AARgba(255, 0, 0, 0.0f)} |
| | | }; |
| | | Map<String, Object> gradientRedColorDic = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToBottom, |
| | | redStopsArr |
| | | ); |
| | | |
| | | Object[][] goldStopsArr = new Object[][]{ |
| | | {0.0, AARgba(255, 215, 0, 1.0f)},//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | {0.5, AARgba(255, 215, 0, 0.2f)}, |
| | | {1.0, AARgba(255, 215, 0, 0.0f)} |
| | | }; |
| | | Map<String, Object> gradientGoldColorDic = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToBottom, |
| | | goldStopsArr |
| | | ); |
| | | |
| | | Object[][] greenStopsArr = new Object[][]{ |
| | | {0.0, AARgba(50, 205, 50, 1.0f)},//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | {0.5, AARgba(50, 205, 50, 0.2f)}, |
| | | {1.0, AARgba(50, 205, 50, 0.0f)} |
| | | }; |
| | | Map<String, Object> gradientGreenColorDic = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToBottom, |
| | | greenStopsArr |
| | | ); |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Area) |
| | | .yAxisVisible(false) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .colorsTheme(new String[]{"#1e90ff", "#ef476f", "#ffd066", "#04d69f"}) |
| | | .markerSymbol(AAChartSymbolType.Circle) |
| | | .markerRadius(5) |
| | | .dataLabelsEnabled(true) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("2017") |
| | | .fillColor(gradientBlueColorDic) |
| | | .lineWidth(6) |
| | | .step((true)) |
| | | .dataLabels(new AADataLabels() |
| | | .style(AAStyle.style("#1e90ff", 11))) |
| | | .data(new Object[]{2.10, 2.54, 2.78, 3.62, 4.41, 4.09, 3.83, 4.47, 4.20, 3.94, 3.80, 3.58, 3.19, 4.30, 3.69, 3.52, 3.02, 3.30}), |
| | | new AASeriesElement() |
| | | .name("2018") |
| | | .fillColor(gradientRedColorDic) |
| | | .lineWidth(6) |
| | | .step((true)) |
| | | .dataLabels(new AADataLabels() |
| | | .style(AAStyle.style("#ef476f", 11)) |
| | | ) |
| | | .data(new Object[]{1.56, 1.91, 2.45, 3.87, 3.24, 4.90, 4.61, 4.10, 4.17, 3.85, 4.17, 3.46, 3.46, 3.55, 3.50, 4.13, 2.58, 2.28}), |
| | | new AASeriesElement() |
| | | .name("2019") |
| | | .fillColor(gradientGoldColorDic) |
| | | .lineWidth(6) |
| | | .step((true)) |
| | | .dataLabels(new AADataLabels() |
| | | .style(AAStyle.style("#ffd066", 11))) |
| | | .data(new Object[]{1.16, 1.67, 2.64, 2.86, 3.00, 3.21, 4.14, 4.07, 3.68, 3.11, 3.41, 3.25, 3.32, 3.07, 3.92, 3.05, 2.18, 3.24}), |
| | | new AASeriesElement() |
| | | .name("2020") |
| | | .fillColor(gradientGreenColorDic) |
| | | .lineWidth(6) |
| | | .step((true)) |
| | | .dataLabels(new AADataLabels() |
| | | .style(AAStyle.style("#04d69f", 11))) |
| | | .data(new Object[]{5.59, 3.09, 4.09, 6.14, 5.33, 6.05, 5.71, 6.22, 6.56, 4.75, 5.27, 6.02, 5.22, 5.77, 6.19, 5.68, 4.33, 5.48}), |
| | | }); |
| | | } |
| | | |
| | | // Refer to https://api.highcharts.com.cn/highcharts#plotOptions.spline.marker.states.hover.enabled |
| | | public static AAChartModel disableSplineChartMarkerHoverEffect() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Spline) |
| | | .title("Disable Spline Chart Marker Hover Effect") |
| | | .categories(new String[]{ |
| | | "一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月"}) |
| | | .markerRadius(0)//marker点半径为0个像素 |
| | | .yAxisLineWidth(0) |
| | | .yAxisGridLineWidth(0) |
| | | .legendEnabled(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo Hot") |
| | | .lineWidth(5.0) |
| | | .color("rgba(220,20,60,1)")//猩红色, alpha 透明度 1 |
| | | .marker(new AAMarker() |
| | | .states(new AAMarkerStates() |
| | | .hover(new AAMarkerHover() |
| | | .enabled(false)))) |
| | | .data(new Object[]{7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6}), |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1203 |
| | | public static AAChartModel configureMaxAndMinDataLabelsForChart() { |
| | | AADataLabels aaDataLabels = new AADataLabels() |
| | | .enabled(true) |
| | | .format("{y} 美元") |
| | | .shape("callout") |
| | | .style(AAStyle.style(AAColor.Red, 15f, AAChartFontWeightType.Bold)) |
| | | .backgroundColor(AAColor.White)// white color |
| | | .borderColor(AAColor.Red)// red color |
| | | .borderRadius(1.5) |
| | | .borderWidth(1.3); |
| | | |
| | | AADataElement minData = new AADataElement() |
| | | .dataLabels(aaDataLabels) |
| | | .y(2.5); |
| | | |
| | | AADataElement maxData = new AADataElement() |
| | | .dataLabels(aaDataLabels) |
| | | .y(49.5); |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Spline) |
| | | .dataLabelsEnabled(false)//是否显示值 |
| | | .tooltipEnabled(false) |
| | | .markerRadius(0) |
| | | .xAxisVisible(false) |
| | | .yAxisVisible(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Show The Max and Min values Data Labels") |
| | | .lineWidth(7) |
| | | .data(new Object[]{7.0, 6.9, minData, 14.5, 18.2, maxData, 5.2, 26.5, 23.3, 26.5, 13.9, 9.6}) |
| | | .color(AAGradientColor.OceanBlue) |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1201 |
| | | public static AAChartModel customVerticalXAxisCategoriesLabelsByHTMLBreakLineTag() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Area) |
| | | .categories(new String[]{ |
| | | "孤<br>岛<br>危<br>机", |
| | | "使<br>命<br>召<br>唤", |
| | | "荣<br>誉<br>勋<br>章", |
| | | "狙<br>击<br>精<br>英", |
| | | "神<br>秘<br>海<br>域", |
| | | "最<br>后<br>生<br>还<br>者", |
| | | "巫<br>师<br>3<br>狂<br>猎", |
| | | "对<br>马<br>之<br>魂", |
| | | "蝙<br>蝠<br>侠<br>阿<br>甘<br>骑<br>士<br>", |
| | | "地<br>狱<br>边<br>境", |
| | | "闪<br>客", |
| | | "忍<br>者<br>之<br>印" |
| | | }) |
| | | .tooltipEnabled(false) |
| | | .borderRadius(3) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("2017") |
| | | .data(new Object[]{7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6}), |
| | | new AASeriesElement() |
| | | .name("2018") |
| | | .data(new Object[]{0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5}), |
| | | new AASeriesElement() |
| | | .name("2019") |
| | | .data(new Object[]{0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0}), |
| | | new AASeriesElement() |
| | | .name("2020") |
| | | .data(new Object[]{3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8}), |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1269 |
| | | public static AAChartModel noMoreGroupingAndOverlapEachOtherColumnChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .categories(new String[]{"11/23", "11/24", "11/25", "11/26", "11/27", "11/28", "11/29"}) |
| | | // .yAxisTickPositions([0, 10, 20, 30, 40, 50]) |
| | | .yAxisMax(50) |
| | | .yAxisMin(0) |
| | | .borderRadius(5) |
| | | .series(new AAColumn[]{ |
| | | new AAColumn() |
| | | .name("总做题") |
| | | .color("#D8D8D8") |
| | | .data(new Object[]{30, 20, 28, 40, 42, 48, 50}) |
| | | .grouping(false) |
| | | , |
| | | new AAColumn() |
| | | .name("正确做题") |
| | | .color("#00D9CD") |
| | | .data(new Object[]{28, 18, 26, 40, 40, 46, 39}) |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1271 |
| | | public static AAChartModel noMoreGroupingAndNestedColumnChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .categories(new String[]{"11/23", "11/24", "11/25", "11/26", "11/27", "11/28", "11/29"}) |
| | | // .yAxisTickPositions([0, 10, 20, 30, 40, 50]) |
| | | .yAxisMax(50) |
| | | .yAxisMin(0) |
| | | .borderRadius(5) |
| | | .series(new Object[]{ |
| | | new AAColumn() |
| | | .name("总目标") |
| | | .color("DeepSkyBlue") |
| | | .data(new Object[]{30, 20, 28, 40, 42, 48, 50}) |
| | | .grouping(false) |
| | | .pointPadding(0.05f) |
| | | , |
| | | new AAColumn() |
| | | .name("完成度") |
| | | .color("#FF3030") //Firebrick1 color |
| | | .data(new Object[]{28, 18, 26, 40, 40, 46, 39}) |
| | | .grouping(false) |
| | | .pointPadding(0.2f) |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/842 |
| | | public static AAChartModel topRoundedCornersStackingColumnChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .title("Top Rounded Corners Stacking Column Chart") |
| | | .colorsTheme(new String[]{"#fe117c", "#ffc069", "#06caf4",}) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo Hot") |
| | | .borderRadiusTopLeft("50%") |
| | | .borderRadiusTopRight("50%") |
| | | .data(new Object[]{2.10, 2.54, 2.78, 3.62, 4.41, 4.09, 3.83, 4.47, 4.20, 3.94, 3.80, 3.58, 3.19, 4.30, 3.69, 3.52, 3.02, 3.30}), |
| | | |
| | | new AASeriesElement() |
| | | .name("Berlin Hot") |
| | | .data(new Object[]{1.56, 1.91, 2.45, 3.87, 3.24, 4.90, 4.61, 4.10, 4.17, 3.85, 4.17, 3.46, 3.46, 3.55, 3.50, 4.13, 2.58, 2.28}), |
| | | |
| | | new AASeriesElement() |
| | | .name("Beijing Hot") |
| | | .data(new Object[]{1.16, 1.67, 2.64, 2.86, 3.00, 3.21, 4.14, 4.07, 3.68, 3.11, 3.41, 3.25, 3.32, 3.07, 3.92, 3.05, 2.18, 3.24}), |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit-Swift/issues/323 |
| | | //https://github.com/AAChartModel/AAChartKit-Swift/issues/346 |
| | | //https://github.com/highcharts/rounded-corners |
| | | public static AAChartModel freeStyleRoundedCornersStackingColumnChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .stacking(AAChartStackingType.Percent) |
| | | .title("Free-Style Rounded Corners Stacking Column Chart") |
| | | .xAxisVisible(false) |
| | | .yAxisGridLineWidth(0) |
| | | .colorsTheme(new Object[]{ |
| | | AAGradientColor.linearGradient(AAColor.rgbColor(128, 255, 165), AAColor.rgbColor(1, 191, 236)), |
| | | AAGradientColor.linearGradient(AAColor.rgbColor(0, 221, 255), AAColor.rgbColor(77, 119, 255)), |
| | | AAGradientColor.linearGradient(AAColor.rgbColor(55, 162, 255), AAColor.rgbColor(116, 21, 219)), |
| | | AAGradientColor.linearGradient(AAColor.rgbColor(255, 0, 135), AAColor.rgbColor(135, 0, 157)), |
| | | AAGradientColor.linearGradient(AAColor.rgbColor(255, 191, 0), AAColor.rgbColor(224, 62, 76)), |
| | | AAGradientColor.PixieDust, |
| | | AAGradientColor.SweetDream, |
| | | AAGradientColor.LusciousLime, |
| | | AAGradientColor.WroughtIron, |
| | | }) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .borderRadiusTopLeft("50%") |
| | | .borderRadiusTopRight("50%") |
| | | .data(new Object[]{2.10, 2.54, 2.78, 3.62, 4.41, 4.09, 3.83, 4.47, 4.20, 3.94, 3.80, 3.58, 3.19, 4.30, 3.69, 3.52, 3.02, 3.30}), |
| | | |
| | | new AASeriesElement() |
| | | .borderRadiusBottomLeft("50%") |
| | | .borderRadiusBottomRight("50%") |
| | | .data(new Object[]{1.56, 1.91, 2.45, 3.87, 3.24, 4.90, 4.61, 4.10, 4.17, 3.85, 4.17, 3.46, 3.46, 3.55, 3.50, 4.13, 2.58, 2.28}), |
| | | |
| | | new AASeriesElement() |
| | | .borderRadiusTopLeft("50%") |
| | | .borderRadiusBottomRight("50%") |
| | | .data(new Object[]{1.16, 1.67, 2.64, 2.86, 3.00, 3.21, 4.14, 4.07, 3.68, 3.11, 3.41, 3.25, 3.32, 3.07, 3.92, 3.05, 2.18, 3.24}), |
| | | |
| | | new AASeriesElement() |
| | | .borderRadiusTopRight("50%") |
| | | .borderRadiusBottomRight("50%") |
| | | .data(new Object[]{5.59, 3.09, 4.09, 6.14, 5.33, 6.05, 5.71, 6.22, 6.56, 4.75, 5.27, 6.02, 5.22, 5.77, 6.19, 5.68, 4.33, 5.48}), |
| | | |
| | | new AASeriesElement() |
| | | .borderRadius(20) |
| | | .data(new Object[]{2.10, 2.54, 2.78, 3.62, 4.41, 4.09, 3.83, 4.47, 4.20, 3.94, 3.80, 3.58, 3.19, 4.30, 3.69, 3.52, 3.02, 3.30}), |
| | | |
| | | new AASeriesElement() |
| | | .borderRadiusTopLeft("50%") |
| | | .borderRadiusBottomLeft("50%") |
| | | .data(new Object[]{5.59, 3.09, 4.09, 6.14, 5.33, 6.05, 5.71, 6.22, 6.56, 4.75, 5.27, 6.02, 5.22, 5.77, 6.19, 5.68, 4.33, 5.48}), |
| | | |
| | | new AASeriesElement() |
| | | .borderRadiusTopRight("50%") |
| | | .borderRadiusBottomLeft("50%") |
| | | .data(new Object[]{1.16, 1.67, 2.64, 2.86, 3.00, 3.21, 4.14, 4.07, 3.68, 3.11, 3.41, 3.25, 3.32, 3.07, 3.92, 3.05, 2.18, 3.24}), |
| | | |
| | | new AASeriesElement() |
| | | .borderRadiusBottomLeft("50%") |
| | | .borderRadiusBottomRight("50%") |
| | | .data(new Object[]{2.10, 2.54, 2.78, 3.62, 4.41, 4.09, 3.83, 4.47, 4.20, 3.94, 3.80, 3.58, 3.19, 4.30, 3.69, 3.52, 3.02, 3.30}), |
| | | |
| | | new AASeriesElement() |
| | | .borderRadiusTopLeft("50%") |
| | | .borderRadiusTopRight("50%") |
| | | .data(new Object[]{1.56, 1.91, 2.45, 3.87, 3.24, 4.90, 4.61, 4.10, 4.17, 3.85, 4.17, 3.46, 3.46, 3.55, 3.50, 4.13, 2.58, 2.28}), |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit-Swift/issues/365 |
| | | public static AAChartModel customColumnChartBorderStyleAndStatesHoverColor() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .colorsTheme(new Object[]{AAColor.DarkGray, AAColor.LightGray})//Colors theme |
| | | .categories(new String[]{ |
| | | "January", "February", "March", "April", "May", "June", |
| | | "July", "August", "September", "October", "November", "December" |
| | | }) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Berlin Hot") |
| | | .borderColor(AAColor.White) |
| | | .borderWidth(3) |
| | | .borderRadius(10) |
| | | .states(new AAStates() |
| | | .hover(new AAHover() |
| | | .color(AAColor.Red))) |
| | | .data(new Object[]{7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6}), |
| | | |
| | | new AASeriesElement() |
| | | .name("Beijing Hot") |
| | | .borderColor(AAColor.White) |
| | | .borderWidth(3) |
| | | .borderRadius(10) |
| | | .states(new AAStates() |
| | | .hover(new AAHover() |
| | | .color("dodgerblue")))// Dodgerblue/道奇藍/#1e90ff十六进制颜色代码 |
| | | .data(new Object[]{0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5}), |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1291 |
| | | public static AAChartModel customLineChartWithColorfulMarkersAndLines() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Line) |
| | | .title("Custom Line Chart With Colorful Markers And Lines") |
| | | .markerRadius(18.0)//marker点半径为8个像素 |
| | | .yAxisLineWidth(0) |
| | | .yAxisGridLineWidth(0) |
| | | .legendEnabled(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Tokyo Hot") |
| | | .lineWidth(5.0) |
| | | .marker(new AAMarker() |
| | | .states(new AAMarkerStates() |
| | | .hover(new AAMarkerHover() |
| | | .radius(40) |
| | | .lineWidth(5)))) |
| | | .data(new Object[]{ |
| | | 2, 4, 8, 16, 32, 64, 128, |
| | | new AADataElement() |
| | | .y(256.0) |
| | | .color(AAColor.Red) |
| | | }) |
| | | .zoneAxis("x") |
| | | .zones(new AAZonesElement[]{ |
| | | new AAZonesElement() |
| | | .value(1) |
| | | .color(AAColor.Red), |
| | | new AAZonesElement() |
| | | .value(2) |
| | | .color(AAColor.Orange), |
| | | new AAZonesElement() |
| | | .value(3) |
| | | .color(AAColor.Yellow), |
| | | new AAZonesElement() |
| | | .value(4) |
| | | .color(AAColor.Green), |
| | | new AAZonesElement() |
| | | .value(5) |
| | | .color(AAColor.Cyan), |
| | | new AAZonesElement() |
| | | .value(6) |
| | | .color(AAColor.Blue), |
| | | new AAZonesElement() |
| | | .value(7) |
| | | .color(AAColor.Purple), |
| | | }) |
| | | , |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1291 |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1293 |
| | | public static AAChartModel customLineChartWithColorfulMarkersAndLines2() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Line) |
| | | .title("Custom Line Chart With Colorful Markers And Lines") |
| | | .markerRadius(25.0)//marker点半径为8个像素 |
| | | .markerSymbol(AAChartSymbolType.Circle) |
| | | .yAxisLineWidth(0) |
| | | .yAxisGridLineWidth(0) |
| | | .legendEnabled(true) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name(AAColor.Blue) |
| | | .lineWidth(20.0) |
| | | .data(new Object[]{ |
| | | 2048, 1024, 1024, 1024, 1024, |
| | | new AADataElement() |
| | | .y(2048) |
| | | .color(AARgba(30, 144, 255, 1.0f)), |
| | | }) |
| | | .zoneAxis("x") |
| | | .zones(new AAZonesElement[]{ |
| | | new AAZonesElement() |
| | | .value(1) |
| | | .color(AARgba(30, 144, 255, 1.0f)), |
| | | new AAZonesElement() |
| | | .value(2) |
| | | .color(AARgba(30, 144, 255, 0.8f)), |
| | | new AAZonesElement() |
| | | .value(3) |
| | | .color(AARgba(30, 144, 255, 0.6f)), |
| | | new AAZonesElement() |
| | | .value(4) |
| | | .color(AARgba(30, 144, 255, 0.4f)), |
| | | new AAZonesElement() |
| | | .value(5) |
| | | .color(AARgba(30, 144, 255, 0.2f)), |
| | | }) |
| | | , |
| | | new AASeriesElement() |
| | | .name(AAColor.Red) |
| | | .lineWidth(20.0) |
| | | .data(new Object[]{ |
| | | 2048, 1024, 1024, 1024, 1024, |
| | | new AADataElement() |
| | | .y(2048) |
| | | .color(AARgba(255, 0, 0, 1.0f)), |
| | | }) |
| | | .zoneAxis("x") |
| | | .zones(new AAZonesElement[]{ |
| | | new AAZonesElement() |
| | | .value(1) |
| | | .color(AARgba(255, 0, 0, 1.0f)), |
| | | new AAZonesElement() |
| | | .value(2) |
| | | .color(AARgba(255, 0, 0, 0.8f)), |
| | | new AAZonesElement() |
| | | .value(3) |
| | | .color(AARgba(255, 0, 0, 0.6f)), |
| | | new AAZonesElement() |
| | | .value(4) |
| | | .color(AARgba(255, 0, 0, 0.4f)), |
| | | new AAZonesElement() |
| | | .value(5) |
| | | .color(AARgba(255, 0, 0, 0.2f)), |
| | | }) |
| | | , |
| | | new AASeriesElement() |
| | | .name(AAColor.Yellow) |
| | | .lineWidth(20.0) |
| | | .data(new Object[]{ |
| | | 2048, 1024, 1024, 1024, 1024, |
| | | new AADataElement() |
| | | .y(2048) |
| | | .color(AARgba(255, 215, 0, 1.0f)), |
| | | }) |
| | | .zoneAxis("x") |
| | | .zones(new AAZonesElement[]{ |
| | | new AAZonesElement() |
| | | .value(1) |
| | | .color(AARgba(255, 215, 0, 1.0f)), |
| | | new AAZonesElement() |
| | | .value(2) |
| | | .color(AARgba(255, 215, 0, 0.8f)), |
| | | new AAZonesElement() |
| | | .value(3) |
| | | .color(AARgba(255, 215, 0, 0.6f)), |
| | | new AAZonesElement() |
| | | .value(4) |
| | | .color(AARgba(255, 215, 0, 0.4f)), |
| | | new AAZonesElement() |
| | | .value(5) |
| | | .color(AARgba(255, 215, 0, 0.2f)), |
| | | }) |
| | | , |
| | | new AASeriesElement() |
| | | .name(AAColor.Green) |
| | | .lineWidth(20.0) |
| | | .data(new Object[]{ |
| | | 2048, 1024, 1024, 1024, 1024, |
| | | new AADataElement() |
| | | .y(2048) |
| | | .color(AARgba(50, 205, 50, 1.0f)), |
| | | }) |
| | | .zoneAxis("x") |
| | | .zones(new AAZonesElement[]{ |
| | | new AAZonesElement() |
| | | .value(1) |
| | | .color(AARgba(50, 205, 50, 1.0f)), |
| | | new AAZonesElement() |
| | | .value(2) |
| | | .color(AARgba(50, 205, 50, 0.8f)), |
| | | new AAZonesElement() |
| | | .value(3) |
| | | .color(AARgba(50, 205, 50, 0.6f)), |
| | | new AAZonesElement() |
| | | .value(4) |
| | | .color(AARgba(50, 205, 50, 0.4f)), |
| | | new AAZonesElement() |
| | | .value(5) |
| | | .color(AARgba(50, 205, 50, 0.2f)), |
| | | }) |
| | | , |
| | | new AASeriesElement() |
| | | .name(AAColor.Purple) |
| | | .lineWidth(20.0) |
| | | .data(new Object[]{ |
| | | 2048, 1024, 1024, 1024, 1024, |
| | | new AADataElement() |
| | | .y(2048) |
| | | .color(AARgba(138, 43, 226, 1.0f)), |
| | | }) |
| | | .zoneAxis("x") |
| | | .zones(new AAZonesElement[]{ |
| | | new AAZonesElement() |
| | | .value(1) |
| | | .color(AARgba(138, 43, 226, 1.0f)), |
| | | new AAZonesElement() |
| | | .value(2) |
| | | .color(AARgba(138, 43, 226, 0.8f)), |
| | | new AAZonesElement() |
| | | .value(3) |
| | | .color(AARgba(138, 43, 226, 0.6f)), |
| | | new AAZonesElement() |
| | | .value(4) |
| | | .color(AARgba(138, 43, 226, 0.4f)), |
| | | new AAZonesElement() |
| | | .value(5) |
| | | .color(AARgba(138, 43, 226, 0.2f)), |
| | | }) |
| | | , |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1294 |
| | | public static AAChartModel drawLineChartWithPointsCoordinates() { |
| | | Object[][] dataArr = new Object[][]{ |
| | | {0, 200}, |
| | | {0, 300}, |
| | | {0, 400}, |
| | | {1, 100}, |
| | | {2, 120}, |
| | | {3, 130} |
| | | }; |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Scatter) |
| | | .title("Draw Line Chart With Points Coordinates") |
| | | .markerSymbol(AAChartSymbolType.Circle) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.BorderBlank) |
| | | .markerRadius(8) |
| | | .colorsTheme(new String[]{AAColor.Red}) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .type(AAChartType.Line) |
| | | .enableMouseTracking(false) |
| | | .showInLegend(false) |
| | | .marker(new AAMarker() |
| | | .enabled(false)) |
| | | .states(new AAStates() |
| | | .inactive(new AAInactive() |
| | | .enabled(false))) |
| | | .data(dataArr), |
| | | new AASeriesElement() |
| | | .name("Red Dot") |
| | | .type(AAChartType.Scatter) |
| | | .data(dataArr), |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1351 |
| | | public static AAChartModel configureSpecialStyleColumnForNegativeDataMixedPositiveData() { |
| | | String[] categoriesArr = new String[]{ |
| | | "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", |
| | | "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒" |
| | | }; |
| | | |
| | | Integer[] dataArr = new Integer[]{ |
| | | -70, -69, -25, -145, -182, -215, -52, -265, -233, -453, -139, -96, |
| | | +70, +69, +25, +145, +182, +215, +52, +265, +233, +453, +139, +96, |
| | | }; |
| | | ArrayList<AADataElement> newDataArr = new ArrayList<>(); |
| | | |
| | | for (Integer dataElementValue : dataArr) { |
| | | AADataLabels aaDataLabels = new AADataLabels() |
| | | .enabled(true) |
| | | .verticalAlign(AAChartVerticalAlignType.Middle) |
| | | .x(0) |
| | | .y(-10); |
| | | |
| | | if (dataElementValue < 0) { |
| | | AADataElement negativeDataElement = new AADataElement() |
| | | .y((-dataElementValue)) |
| | | .color(AAColor.Green) |
| | | .dataLabels(aaDataLabels |
| | | .format("-{y} 美元") |
| | | .style(AAStyle.style(AAColor.Green, 11, AAChartFontWeightType.Thin))); |
| | | newDataArr.add(negativeDataElement); |
| | | } else { |
| | | AADataElement positiveDataElement = new AADataElement() |
| | | .y((dataElementValue)) |
| | | .color(AAColor.Red) |
| | | .dataLabels(aaDataLabels |
| | | .format("+{y} 美元") |
| | | .style(AAStyle.style(AAColor.Red, 11, AAChartFontWeightType.Thin))); |
| | | newDataArr.add(positiveDataElement); |
| | | } |
| | | } |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .categories(categoriesArr) |
| | | .tooltipEnabled(false) |
| | | .yAxisVisible(false) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("虚构数据") |
| | | .data(newDataArr.toArray()) |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit-Swift/issues/389 |
| | | public static AAChartModel configureMultiLevelStopsArrGradientColorAreasplineMixedLineChart() { |
| | | ArrayList<Object> randomNumArrA = new ArrayList<>(); |
| | | ArrayList<Object> randomNumArrB = new ArrayList<>(); |
| | | double y1; |
| | | double y2; |
| | | int Q = (int) (Math.random() * 50); |
| | | int range = 129; |
| | | for (int x = 0; x < range; x++) { |
| | | y1 = Math.sin(Q * (x * Math.PI / 180)) + x * 2.0 * 0.01; |
| | | y2 = Math.cos(Q * (x * Math.PI / 180)) + x * 3.0 * 0.01; |
| | | randomNumArrA.add(y1); |
| | | randomNumArrB.add(y2); |
| | | } |
| | | |
| | | Object[][] redStopsArr = new Object[][]{ |
| | | {0.0, AARgba(255, 0, 0, 1.0f)},//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | {0.2, AARgba(255, 0, 0, 0.2f)}, |
| | | {0.4, AARgba(255, 0, 0, 0.1f)}, |
| | | {0.6, AARgba(255, 0, 0, 0.05f)}, |
| | | {0.8, AARgba(255, 0, 0, 0.01f)}, |
| | | {1.0, AAColor.Clear} |
| | | }; |
| | | |
| | | Map<String, Object> gradientRedColorDic = AAGradientColor.linearGradient( |
| | | AALinearGradientDirection.ToBottom, |
| | | redStopsArr |
| | | ); |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Areaspline) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .backgroundColor(AAColor.Black) |
| | | .colorsTheme(new String[]{"#1e90ff", "#04d69f", "#ef476f", "#ffd066",}) |
| | | .dataLabelsEnabled(false) |
| | | .markerSymbol(AAChartSymbolType.Circle) |
| | | .markerRadius(5) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank) |
| | | .yAxisGridLineWidth(0.5f) |
| | | .xAxisGridLineWidth(0.5f) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("2017") |
| | | .type(AAChartType.Spline) |
| | | .lineWidth(6f) |
| | | .data(randomNumArrA.toArray()), |
| | | new AASeriesElement() |
| | | .name("2018") |
| | | .type(AAChartType.Spline) |
| | | .lineWidth(6f) |
| | | .data(randomNumArrB.toArray()), |
| | | new AASeriesElement() |
| | | .name("2020") |
| | | .fillColor(gradientRedColorDic) |
| | | .lineWidth(6f) |
| | | .threshold(-4f) |
| | | .data(randomNumArrA.toArray()), |
| | | }); |
| | | } |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1401 |
| | | public static AAChartModel connectNullsForSingleAASeriesElement() { |
| | | Object[] dataArr = new Object[]{ |
| | | 0.45, null, null, |
| | | 0.55, 0.58, 0.62, null, null, |
| | | 0.56, 0.67, 0.50, 0.34, 0.50, null, null, null, null, |
| | | 0.23, 0.47, 0.46, 0.38, 0.56, 0.48, 0.36, null, null, null, null, null, null, null, null, |
| | | 0.74, 0.66, 0.65, 0.71, 0.59, 0.65, 0.77, 0.52, 0.53, 0.58, 0.53, |
| | | }; |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Spline) |
| | | .subtitle("虚拟数据") |
| | | .colorsTheme(new String[]{"#1e90ff", "#ef476f", "#ffd066", "#04d69f"}) |
| | | .yAxisTitle("摄氏度") |
| | | .dataLabelsEnabled(false) |
| | | .yAxisGridLineWidth(0f) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .markerRadius(8f) |
| | | .markerSymbolStyle(AAChartSymbolStyleType.BorderBlank) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("Do NOT Connect Nulls") |
| | | .lineWidth(5f) |
| | | .connectNulls(false) |
| | | .data(dataArr), |
| | | new AASeriesElement() |
| | | .name("Connect Nulls") |
| | | .lineWidth(5f) |
| | | .connectNulls(true) |
| | | .data(dataArr), |
| | | new AASeriesElement() |
| | | .name("Do NOT Connect Nulls") |
| | | .lineWidth(5f) |
| | | .connectNulls(false) |
| | | .data(dataArr), |
| | | new AASeriesElement() |
| | | .name("Connect Nulls") |
| | | .lineWidth(5f) |
| | | .connectNulls(true) |
| | | .data(dataArr) |
| | | }); |
| | | } |
| | | |
| | | |
| | | //- (NSArray *)generateRandomNumberArrayWithLength:(NSUInteger)length |
| | | // randomRange:(NSUInteger)randomRange |
| | | // minNum:(NSUInteger)minNum { |
| | | // NSMutableArray *randomNumArrA = [NSMutableArray array]; |
| | | // for (NSUInteger x = 0; x < length; x++) { |
| | | // NSUInteger randomNum = arc4random() % randomRange + minNum; |
| | | // [randomNumArrA addObject:@(randomNum)]; |
| | | // } |
| | | // return randomNumArrA; |
| | | // } |
| | | |
| | | public static ArrayList<Object> generateRandomNumberArrayWithLength(int length, int randomRange, int minNum) { |
| | | ArrayList<Object> randomNumArrA = new ArrayList<>(); |
| | | for (int x = 0; x < length; x++) { |
| | | int randomNum = (int) (Math.random() * randomRange + minNum); |
| | | randomNumArrA.add(randomNum); |
| | | } |
| | | return randomNumArrA; |
| | | } |
| | | |
| | | |
| | | // - (NSArray *)generateRandomNumberMixedNullArrayWithLength:(NSUInteger)length |
| | | // randomRange:(NSUInteger)randomRange |
| | | // minNum:(NSUInteger)minNum { |
| | | // NSMutableArray *randomNumArrA = [NSMutableArray array]; |
| | | // for (NSUInteger x = 0; x < length; x++) { |
| | | // if ((100 < x && x < 150) || (300 < x && x < 350)) { |
| | | // NSUInteger randomNum = arc4random() % randomRange + minNum; |
| | | // [randomNumArrA addObject:@(randomNum)]; |
| | | // } else { |
| | | // [randomNumArrA addObject:NSNull.null]; |
| | | // } |
| | | // } |
| | | // return randomNumArrA; |
| | | // } |
| | | |
| | | public static ArrayList<Object> generateRandomNumberMixedNullArrayWithLength(int length, int randomRange, int minNum) { |
| | | ArrayList<Object> randomNumArrA = new ArrayList<>(); |
| | | for (int x = 0; x < length; x++) { |
| | | if ((100 < x && x < 150) || (300 < x && x < 350)) { |
| | | int randomNum = (int) (Math.random() * randomRange + minNum); |
| | | randomNumArrA.add(randomNum); |
| | | } else { |
| | | randomNumArrA.add(null); |
| | | } |
| | | } |
| | | return randomNumArrA; |
| | | } |
| | | |
| | | |
| | | ////https://github.com/AAChartModel/AAChartKit/issues/1419 |
| | | //- (AAChartModel *)lineChartsWithLargeDifferencesInTheNumberOfDataInDifferentSeriesElement { |
| | | // return AAChartModel.new |
| | | // .chartTypeSet(AAChartTypeLine) |
| | | // .backgroundColorSet(AAColor.blackColor) |
| | | // .colorsThemeSet(@[@"#1e90ff",@"#04d69f",@"#ef476f",@"#ffd066",]) |
| | | // .dataLabelsEnabledSet(false) |
| | | // .markerRadiusSet(@0) |
| | | // .seriesSet(@[ |
| | | // AASeriesElement.new |
| | | // .nameSet(@"2017") |
| | | // .lineWidthSet(@6) |
| | | // .dataSet([self generateRandomNumberMixedNullArrayWithLength:3550 randomRange:5 minNum:100]), |
| | | // AASeriesElement.new |
| | | // .nameSet(@"2018") |
| | | // .lineWidthSet(@6) |
| | | // .dataSet([self generateRandomNumberArrayWithLength:3550 randomRange:100 minNum:200]), |
| | | // AASeriesElement.new |
| | | // .nameSet(@"2019") |
| | | // .lineWidthSet(@6) |
| | | // .dataSet([self generateRandomNumberArrayWithLength:3550 randomRange:150 minNum:400]), |
| | | // AASeriesElement.new |
| | | // .nameSet(@"2020") |
| | | // .lineWidthSet(@6) |
| | | // .dataSet([self generateRandomNumberArrayWithLength:3550 randomRange:150 minNum:600]), |
| | | // ]); |
| | | //} |
| | | |
| | | //https://github.com/AAChartModel/AAChartKit/issues/1419 |
| | | public static AAChartModel lineChartsWithLargeDifferencesInTheNumberOfDataInDifferentSeriesElement() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Line) |
| | | .backgroundColor("#000000") |
| | | .colorsTheme(new String[]{"#1e90ff", "#04d69f", "#ef476f", "#ffd066"}) |
| | | .dataLabelsEnabled(false) |
| | | .markerRadius(0f) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("2017") |
| | | .lineWidth(6f) |
| | | .data(generateRandomNumberMixedNullArrayWithLength(3550, 5, 100).toArray()), |
| | | new AASeriesElement() |
| | | .name("2018") |
| | | .lineWidth(6f) |
| | | .data(generateRandomNumberArrayWithLength(3550, 100, 200).toArray()), |
| | | new AASeriesElement() |
| | | .name("2019") |
| | | .lineWidth(6f) |
| | | .data(generateRandomNumberArrayWithLength(3550, 150, 400).toArray()), |
| | | new AASeriesElement() |
| | | .name("2020") |
| | | .lineWidth(6f) |
| | | .data(generateRandomNumberArrayWithLength(3550, 150, 600).toArray()), |
| | | }); |
| | | } |
| | | |
| | | public static AAChartModel largeDataStackingColumnChart() { |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Column) |
| | | .backgroundColor("#000000") |
| | | .colorsTheme(new String[]{"#1e90ff", "#04d69f", "#ef476f", "#ffd066"}) |
| | | .dataLabelsEnabled(false) |
| | | .stacking(AAChartStackingType.Normal) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("2018") |
| | | .lineWidth(6f) |
| | | .data(generateRandomNumberArrayWithLength(3550, 100, 200).toArray()), |
| | | new AASeriesElement() |
| | | .name("2019") |
| | | .lineWidth(6f) |
| | | .data(generateRandomNumberArrayWithLength(3550, 150, 400).toArray()), |
| | | new AASeriesElement() |
| | | .name("2020") |
| | | .lineWidth(6f) |
| | | .data(generateRandomNumberArrayWithLength(3550, 150, 600).toArray()), |
| | | }); |
| | | } |
| | | |
| | | ////https://github.com/AAChartModel/AAChartCore-Kotlin/issues/149 |
| | | //- (AAChartModel *)customAreasplineChartWithColorfulGradientColorZones { |
| | | // NSArray *redStopsArr = @[ |
| | | // @[@0.0, AARgbaColor(255, 0, 0, 1.0)],//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | // @[@1.0, AAColor.clearColor] |
| | | // ]; |
| | | // |
| | | // NSArray *greenStopsArr = @[ |
| | | // @[@0.0, AARgbaColor(0, 255, 0, 1.0)],//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | // @[@1.0, AAColor.clearColor] |
| | | // ]; |
| | | // |
| | | // NSArray *blueStopsArr = @[ |
| | | // @[@0.0, AARgbaColor(0, 0, 255, 1.0)],//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | // @[@1.0, AAColor.clearColor] |
| | | // ]; |
| | | // |
| | | // NSDictionary *redGradientColorDic = [AAGradientColor gradientColorWithDirection:AALinearGradientDirectionToBottom stopsArray:redStopsArr]; |
| | | // NSDictionary *greenGradientColorDic = [AAGradientColor gradientColorWithDirection:AALinearGradientDirectionToBottom stopsArray:greenStopsArr]; |
| | | // NSDictionary *blueGradientColorDic = [AAGradientColor gradientColorWithDirection:AALinearGradientDirectionToBottom stopsArray:blueStopsArr]; |
| | | // |
| | | // AADataElement *singleSpecialData = AADataElement.new |
| | | // .markerSet(AAMarker.new |
| | | // .radiusSet(@8)//曲线连接点半径 |
| | | // .symbolSet(AAChartSymbolTypeCircle)//曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" |
| | | // .fillColorSet(AAColor.whiteColor)//点的填充色(用来设置折线连接点的填充色) |
| | | // .lineWidthSet(@5)//外沿线的宽度(用来设置折线连接点的轮廓描边的宽度) |
| | | // //外沿线的颜色(用来设置折线连接点的轮廓描边颜色,当值为空字符串时,默认取数据点或数据列的颜色) |
| | | // .lineColorSet(@"#1E90FF")//道奇蓝 |
| | | // ) |
| | | // .dataLabelsSet(AADataLabels.new |
| | | // .enabledSet(true) |
| | | // .allowOverlapSet(true) |
| | | // .useHTMLSet(true) |
| | | // .backgroundColorSet(AARgbaColor(65, 111, 166, 1.0)) |
| | | // .borderRadiusSet(@10) |
| | | // .shapeSet(@"callout") |
| | | // .formatSet(@"{point.category}<br>{series.name}: {point.y} %") |
| | | // .styleSet(AAStyleColorSizeWeight(AAColor.whiteColor, 12, AAChartFontWeightTypeBold)) |
| | | // .xSet(@-80).ySet(@(5)) |
| | | // .alignSet(AAChartAlignTypeCenter) |
| | | // .verticalAlignSet(AAChartVerticalAlignTypeTop) |
| | | // .overflowSet(@"none") |
| | | // .cropSet(false) |
| | | // ) |
| | | // .ySet(@85.3); |
| | | // |
| | | // AAStyle *axisLabelsStyle = AAStyleColorSizeWeight(AAColor.whiteColor, 12, AAChartFontWeightTypeBold); |
| | | // |
| | | // return AAChartModel.new |
| | | // .chartTypeSet(AAChartTypeAreaspline) |
| | | // .backgroundColorSet(AAColor.blackColor) |
| | | // .categoriesSet(@[ |
| | | // @"Jan", @"Feb", @"Mar", @"Apr", @"May", @"Jun", |
| | | // @"Jul", @"Aug", @"Sep", @"Oct", @"Nov", @"Dec" |
| | | // ]) |
| | | // .dataLabelsEnabledSet(false) |
| | | // .legendEnabledSet(false) |
| | | // .markerRadiusSet(@0) |
| | | // .xAxisLabelsStyleSet(axisLabelsStyle) |
| | | // .yAxisLabelsStyleSet(axisLabelsStyle) |
| | | // .xAxisGridLineStyleSet([AALineStyle styleWithColor:AAColor.whiteColor dashStyle:AAChartLineDashStyleTypeLongDashDotDot width:@0.5]) |
| | | // .yAxisGridLineStyleSet([AALineStyle styleWithWidth:@0]) |
| | | // .seriesSet(@[ |
| | | // AASeriesElement.new |
| | | // .nameSet(@"空气湿度") |
| | | // .lineWidthSet(@6) |
| | | // .zoneAxisSet(@"x") |
| | | // .zonesSet(@[ |
| | | // AAZonesElement.new |
| | | // .valueSet(@2) |
| | | // .colorSet(AAColor.redColor) |
| | | // .fillColorSet((id)redGradientColorDic ), |
| | | // AAZonesElement.new |
| | | // .valueSet(@5) |
| | | // .colorSet(AAColor.greenColor) |
| | | // .fillColorSet((id)greenGradientColorDic), |
| | | // AAZonesElement.new |
| | | // .colorSet(AAColor.blueColor) |
| | | // .fillColorSet((id)blueGradientColorDic), |
| | | // ]) |
| | | // .dataSet(@[@56.5, @33.3, @85.3, @23.9, @29.6, @34.5, @28.2, @26.5, @15.2, @56.5, @33.3, singleSpecialData]), |
| | | // ]); |
| | | //} |
| | | |
| | | //https://github.com/AAChartModel/AAChartCore-Kotlin/issues/149 |
| | | public static AAChartModel customAreasplineChartWithColorfulGradientColorZones() { |
| | | Object[][] redStopsArr = new Object[][]{ |
| | | new Object[]{0.0f, AARgba(255, 0, 0, 1.0f)},//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | | new Object[]{1.0f, AAColor.Clear} |
| | | }; |
| | | |
| | | Object[][] greenStopsArr = new Object[][]{ |
| | | new Object[]{0.0f, AARgba(0, 255, 0, 1.0f)}, |
| | | new Object[]{1.0f, AAColor.Clear} |
| | | }; |
| | | |
| | | Object[][] blueStopsArr = new Object[][]{ |
| | | new Object[]{0.0f, AARgba(0, 0, 255, 1.0f)}, |
| | | new Object[]{1.0f, AAColor.Clear} |
| | | }; |
| | | |
| | | Map<String, Object> redGradientColorDic = AAGradientColor.linearGradient(AALinearGradientDirection.ToBottom, redStopsArr); |
| | | Map<String, Object> greenGradientColorDic = AAGradientColor.linearGradient(AALinearGradientDirection.ToBottom, greenStopsArr); |
| | | Map<String, Object> blueGradientColorDic = AAGradientColor.linearGradient(AALinearGradientDirection.ToBottom, blueStopsArr); |
| | | |
| | | AADataElement singleSpecialData = new AADataElement() |
| | | .marker(new AAMarker() |
| | | .radius(8f)//曲线连接点半径 |
| | | .symbol(AAChartSymbolType.Circle)//曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" |
| | | .fillColor(AAColor.White)//点的填充色(用来设置折线连接点的填充色) |
| | | .lineWidth(5f)//外沿线的宽度(用来设置折线连接点的轮廓描边的宽度) |
| | | //外沿线的颜色(用来设置折线连接点的轮廓描边颜色,当值为空字符串时,默认取数据点或数据列的颜色) |
| | | .lineColor(AAColor.Red) |
| | | ) |
| | | .dataLabels(new AADataLabels() |
| | | .enabled(true) |
| | | .allowOverlap(true) |
| | | .useHTML(true) |
| | | .backgroundColor(AARgba(65, 111, 166, 1.0f)) |
| | | .borderRadius(10f) |
| | | .shape("callout") |
| | | .format("{point.category}<br>{series.name}: {point.y} %") |
| | | .style(new AAStyle() |
| | | .color(AAColor.White) |
| | | .fontSize(12f) |
| | | .fontWeight(AAChartFontWeightType.Bold) |
| | | ) |
| | | .x(-80f) |
| | | .y(5f) |
| | | .align(AAChartAlignType.Center) |
| | | .verticalAlign(AAChartVerticalAlignType.Top) |
| | | .overflow("none") |
| | | .crop(false) |
| | | ) |
| | | .y(85.3f); |
| | | |
| | | AAStyle axisLabelsStyle = new AAStyle() |
| | | .color(AAColor.White) |
| | | .fontSize(12f) |
| | | .fontWeight(AAChartFontWeightType.Bold); |
| | | |
| | | return new AAChartModel() |
| | | .chartType(AAChartType.Areaspline) |
| | | .backgroundColor(AAColor.Black) |
| | | .categories(new String[]{ |
| | | "Jan", "Feb", "Mar", "Apr", "May", "Jun", |
| | | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" |
| | | }) |
| | | .dataLabelsEnabled(false) |
| | | .legendEnabled(false) |
| | | .markerRadius(0f) |
| | | // .xAxisLabelsStyle(axisLabelsStyle) |
| | | // .yAxisLabelsStyle(axisLabelsStyle) |
| | | // .xAxisGridLineStyle(new AALineStyle() |
| | | // .color(AAColor.White) |
| | | // .dashStyle(AAChartLineDashStyleType.LongDashDotDot) |
| | | // .width(0.5f) |
| | | // ) |
| | | // .yAxisGridLineStyle(new AALineStyle() |
| | | // .width(0f) |
| | | // ) |
| | | .series(new AASeriesElement[]{ |
| | | new AASeriesElement() |
| | | .name("空气湿度") |
| | | .lineWidth(6f) |
| | | .zoneAxis("x") |
| | | .zones(new AAZonesElement[]{ |
| | | new AAZonesElement() |
| | | .value(2) |
| | | .color(AAColor.Red) |
| | | .fillColor(redGradientColorDic), |
| | | new AAZonesElement() |
| | | .value(5) |
| | | .color(AAColor.Green) |
| | | .fillColor(greenGradientColorDic), |
| | | new AAZonesElement() |
| | | .color(AAColor.Blue) |
| | | .fillColor(blueGradientColorDic), |
| | | }) |
| | | .data(new Object[]{ |
| | | 56.5f, 33.3f, 85.3f, 23.9f, 29.6f, 34.5f, 28.2f, 26.5f, 15.2f, 56.5f, 33.3f, singleSpecialData |
| | | }), |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | package com.hdl.photovoltaic.ui.home; |
| | | |
| | | |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.adjustYAxisMaxAndMinValues; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureAreaChartThreshold; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureChartWithShadowStyle; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureColorfulChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureColorfulColumnChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureColorfulDataLabelsStepLineChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureColorfulGradientAreaChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureColorfulGradientColorAndColorfulDataLabelsStepAreaChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureColorfulGradientColorChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureColorfulGradientSplineChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureColorfulShadowSplineChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureDiscontinuousDataChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureGradientColorAreasplineChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureHexagonRadarChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureMaxAndMinDataLabelsForChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureMultiLevelStopsArrGradientColorAreasplineMixedLineChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureNightingaleRoseChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configurePentagonRadarChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureQuadrangleRadarChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureSpecialStyleColumnForNegativeDataMixedPositiveData; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureSpecialStyleColumnOfSingleDataElementChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureSpecialStyleMarkerOfSingleDataElementChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.configureTriangleRadarChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.connectNullsForSingleAASeriesElement; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customAreasplineChartWithColorfulGradientColorZones; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customBarChartHoverColorAndSelectColor; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customChartHoverAndSelectHaloStyle; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customColumnChartBorderStyleAndStatesHoverColor; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customLineChartMarkerSymbolContent; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customLineChartWithColorfulMarkersAndLines; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customLineChartWithColorfulMarkersAndLines2; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customNormalStackingChartDataLabelsContentAndStyle; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customScatterChartMarkerSymbolContent; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customSpecialStyleDataLabelOfSingleDataElementChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customSplineChartMarkerStatesHoverStyle; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.customVerticalXAxisCategoriesLabelsByHTMLBreakLineTag; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.disableSomeOfLinesMouseTrackingEffect; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.disableSplineChartMarkerHoverEffect; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.doubleLayerPieChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.drawLineChartWithPointsCoordinates; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.freeStyleRoundedCornersStackingColumnChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.largeDataStackingColumnChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.lineChartsWithLargeDifferencesInTheNumberOfDataInDifferentSeriesElement; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.noMoreGroupingAndNestedColumnChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.noMoreGroupingAndOverlapEachOtherColumnChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.splineChartHoverLineWithNoChangeAndCustomMarkerStatesHoverStyle; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.topRoundedCornersStackingColumnChart; |
| | | import static com.hdl.photovoltaic.ui.home.CustomStyleChartComposer.upsideDownPyramidChart; |
| | | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | |
| | | |
| | | FragmentHomePageBinding viewBinding; |
| | | |
| | | AAChartView aaChartView; |
| | | AAChartView aaChartView1; |
| | | |
| | | AAChartModel aaChartModel; |
| | | AAChartModel aaChartModel1; |
| | | AAChartView aaChartView2; |
| | | |
| | | AAChartModel aaChartModel2; |
| | | AAChartView aaChartView3; |
| | | |
| | | AAChartModel aaChartModel3; |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public void onBindView(Bundle savedInstanceState) { |
| | | setUpAAChartView(); |
| | | viewBinding.test.setOnClickListener(new View.OnClickListener() { |
| | | viewBinding.test1.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | |
| | | setUpAAChartView(1); |
| | | } |
| | | }); |
| | | viewBinding.test2.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | setUpAAChartView(2); |
| | | } |
| | | }); |
| | | viewBinding.test3.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | setUpAAChartView(3); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void setUpAAChartView() { |
| | | aaChartView = viewBinding.AAChartView; |
| | | aaChartView.callBack = this; |
| | | aaChartModel = configureAAChartModel(); |
| | | aaChartView.aa_drawChartWithChartModel(aaChartModel); |
| | | private void setUpAAChartView(int value) { |
| | | if (value == 1) { |
| | | aaChartView1 = viewBinding.AAChartView1; |
| | | aaChartView1.callBack = this; |
| | | aaChartModel1 = configureAAChartModel(); |
| | | aaChartView1.aa_drawChartWithChartModel(aaChartModel1); |
| | | } else if (value == 2) { |
| | | aaChartView2 = viewBinding.AAChartView2; |
| | | aaChartView2.callBack = this; |
| | | aaChartModel2 = configureColorfulColumnChart();// configureTheAAChartModel("colorfulColumnChart"); |
| | | aaChartView2.aa_drawChartWithChartModel(aaChartModel2); |
| | | } else if (value == 3) { |
| | | aaChartView3 = viewBinding.AAChartView3; |
| | | aaChartView3.callBack = this; |
| | | aaChartModel3 = configureAAChartModel(); |
| | | aaChartView3.aa_drawChartWithChartModel(aaChartModel3); |
| | | } |
| | | } |
| | | |
| | | private AAChartModel configureAAChartModel() { |
| | | // Intent intent = getIntent(); |
| | | // String chartType = intent.getStringExtra("chartType"); |
| | | // int position = intent.getIntExtra("position", 0); |
| | | |
| | | aaChartModel = BasicChartComposer.configureAreaChart(); |
| | | // configureTheStyleForDifferentTypeChart(chartType, position); |
| | | String chartType = AAChartType.Area; |
| | | int position = 0; |
| | | aaChartModel1 = BasicChartComposer.configureAreaChart(); |
| | | configureTheStyleForDifferentTypeChart(chartType, position); |
| | | // configureViewsVisibility(chartType); |
| | | |
| | | return aaChartModel; |
| | | return aaChartModel1; |
| | | } |
| | | |
| | | private void configureTheStyleForDifferentTypeChart(String chartType, int position) { |
| | | if ((chartType.equals(AAChartType.Area) || chartType.equals(AAChartType.Line)) |
| | | && (position == 4 || position == 5)) { |
| | | aaChartModel = BasicChartComposer.configureStepAreaChartAndStepLineChart(); |
| | | aaChartModel1 = BasicChartComposer.configureStepAreaChartAndStepLineChart(); |
| | | } else if (chartType.equals(AAChartType.Column) || chartType.equals(AAChartType.Bar)) { |
| | | |
| | | aaChartModel = BasicChartComposer.configureColumnChartAndBarChart(); |
| | | aaChartModel1 = BasicChartComposer.configureColumnChartAndBarChart(); |
| | | } else if (chartType.equals(AAChartType.Area) || chartType.equals(AAChartType.Areaspline)) { |
| | | aaChartModel = BasicChartComposer.configureAreaChartAndAreasplineChartStyle(chartType); |
| | | aaChartModel1 = BasicChartComposer.configureAreaChartAndAreasplineChartStyle(chartType); |
| | | } else if (chartType.equals(AAChartType.Line) || chartType.equals(AAChartType.Spline)) { |
| | | aaChartModel = BasicChartComposer.configureLineChartAndSplineChartStyle(chartType); |
| | | aaChartModel1 = BasicChartComposer.configureLineChartAndSplineChartStyle(chartType); |
| | | } |
| | | aaChartModel.chartType = chartType; |
| | | aaChartModel1.chartType = chartType; |
| | | } |
| | | |
| | | private AAChartModel configureTheAAChartModel(String chartType) { |
| | | switch (chartType) { |
| | | case "colorfulChart": |
| | | return configureColorfulChart(); |
| | | case "gradientColorfulChart": |
| | | return configureColorfulGradientColorChart(); |
| | | case "discontinuousDataChart": |
| | | return configureDiscontinuousDataChart(); |
| | | case "colorfulColumnChart": |
| | | return configureColorfulColumnChart(); |
| | | case "nightingaleRoseChart": |
| | | return configureNightingaleRoseChart(); |
| | | case "chartWithShadowStyle": |
| | | return configureChartWithShadowStyle(); |
| | | case "colorfulGradientAreaChart": |
| | | return configureColorfulGradientAreaChart(); |
| | | case "colorfulGradientSplineChart": |
| | | return configureColorfulGradientSplineChart(); |
| | | case "gradientColorAreasplineChart": |
| | | return configureGradientColorAreasplineChart(); |
| | | case "SpecialStyleMarkerOfSingleDataElementChart": |
| | | return configureSpecialStyleMarkerOfSingleDataElementChart(); |
| | | case "SpecialStyleColumnOfSingleDataElementChart": |
| | | return configureSpecialStyleColumnOfSingleDataElementChart(); |
| | | case "AreaChartThreshold": |
| | | return configureAreaChartThreshold(); |
| | | case "customScatterChartMarkerSymbolContent": |
| | | return customScatterChartMarkerSymbolContent(); |
| | | case "customLineChartMarkerSymbolContent": |
| | | return customLineChartMarkerSymbolContent(); |
| | | case "TriangleRadarChart": |
| | | return configureTriangleRadarChart(); |
| | | case "QuadrangleRadarChart": |
| | | return configureQuadrangleRadarChart(); |
| | | case "PentagonRadarChart": |
| | | return configurePentagonRadarChart(); |
| | | case "HexagonRadarChart": |
| | | return configureHexagonRadarChart(); |
| | | case "adjustYAxisMaxAndMinValues": |
| | | return adjustYAxisMaxAndMinValues(); |
| | | case "customSpecialStyleDataLabelOfSingleDataElementChart": |
| | | return customSpecialStyleDataLabelOfSingleDataElementChart(); |
| | | case "customBarChartHoverColorAndSelectColor": |
| | | return customBarChartHoverColorAndSelectColor(); |
| | | case "customChartHoverAndSelectHaloStyle": |
| | | return customChartHoverAndSelectHaloStyle(); |
| | | case "customSplineChartMarkerStatesHoverStyle": |
| | | return customSplineChartMarkerStatesHoverStyle(); |
| | | case "splineChartHoverLineWithNoChangeAndCustomMarkerStatesHoverStyle": |
| | | return splineChartHoverLineWithNoChangeAndCustomMarkerStatesHoverStyle(); |
| | | case "customNormalStackingChartDataLabelsContentAndStyle": |
| | | return customNormalStackingChartDataLabelsContentAndStyle(); |
| | | case "upsideDownPyramidChart": |
| | | return upsideDownPyramidChart(); |
| | | case "doubleLayerPieChart": |
| | | return doubleLayerPieChart(); |
| | | case "disableSomeOfLinesMouseTrackingEffect": |
| | | return disableSomeOfLinesMouseTrackingEffect(); |
| | | case "configureColorfulShadowSplineChart": |
| | | return configureColorfulShadowSplineChart(); |
| | | case "configureColorfulDataLabelsStepLineChart": |
| | | return configureColorfulDataLabelsStepLineChart(); |
| | | case "configureColorfulGradientColorAndColorfulDataLabelsStepAreaChart": |
| | | return configureColorfulGradientColorAndColorfulDataLabelsStepAreaChart(); |
| | | case "disableSplineChartMarkerHoverEffect": |
| | | return disableSplineChartMarkerHoverEffect(); |
| | | case "configureMaxAndMinDataLabelsForChart": |
| | | return configureMaxAndMinDataLabelsForChart(); |
| | | case "customVerticalXAxisCategoriesLabelsByHTMLBreakLineTag": |
| | | return customVerticalXAxisCategoriesLabelsByHTMLBreakLineTag(); |
| | | case "noMoreGroupingAndOverlapEachOtherColumnChart": |
| | | return noMoreGroupingAndOverlapEachOtherColumnChart(); |
| | | case "noMoreGroupingAndNestedColumnChart": |
| | | return noMoreGroupingAndNestedColumnChart(); |
| | | case "topRoundedCornersStackingColumnChart": |
| | | return topRoundedCornersStackingColumnChart(); |
| | | case "freeStyleRoundedCornersStackingColumnChart": |
| | | return freeStyleRoundedCornersStackingColumnChart(); |
| | | case "customColumnChartBorderStyleAndStatesHoverColor": |
| | | return customColumnChartBorderStyleAndStatesHoverColor(); |
| | | case "customLineChartWithColorfulMarkersAndLines": |
| | | return customLineChartWithColorfulMarkersAndLines(); |
| | | case "customLineChartWithColorfulMarkersAndLines2": |
| | | return customLineChartWithColorfulMarkersAndLines2(); |
| | | case "drawLineChartWithPointsCoordinates": |
| | | return drawLineChartWithPointsCoordinates(); |
| | | case "configureSpecialStyleColumnForNegativeDataMixedPositiveData": |
| | | return configureSpecialStyleColumnForNegativeDataMixedPositiveData(); |
| | | case "configureMultiLevelStopsArrGradientColorAreasplineMixedLineChart": |
| | | return configureMultiLevelStopsArrGradientColorAreasplineMixedLineChart(); |
| | | case "connectNullsForSingleAASeriesElement": |
| | | return connectNullsForSingleAASeriesElement(); |
| | | case "lineChartsWithLargeDifferencesInTheNumberOfDataInDifferentSeriesElement": |
| | | return lineChartsWithLargeDifferencesInTheNumberOfDataInDifferentSeriesElement(); |
| | | case "customAreasplineChartWithColorfulGradientColorZones": |
| | | return customAreasplineChartWithColorfulGradientColorZones(); |
| | | case "largeDataStackingColumnChart": |
| | | return largeDataStackingColumnChart(); |
| | | |
| | | |
| | | } |
| | | return configureColorfulChart(); |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="@dimen/dp_13" /> |
| | | <gradient |
| | | android:angle="315" |
| | | android:endColor="#00FFECD9" |
| | | android:startColor="#FFE2C6" /> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="@dimen/dp_8" /> |
| | | <solid android:color="#FFFFFF" /> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="@dimen/dp_8" /> |
| | | <solid android:color="#38c494" /> |
| | | </shape> |
| | |
| | | tools:context=".ui.home.HomePageFragment"> |
| | | |
| | | <TextView |
| | | android:id="@+id/test" |
| | | android:id="@+id/home_page_title_tv" |
| | | style="@style/Text20Style" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="点击测试" |
| | | android:textSize="@dimen/dp_30" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_height="@dimen/dp_24" |
| | | android:layout_marginStart="@dimen/dp_16" |
| | | android:layout_marginTop="@dimen/dp_9" |
| | | android:text="@string/power_shome_page" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartView |
| | | android:id="@+id/AAChartView" |
| | | <ImageView |
| | | android:id="@+id/home_page_station_add_iv" |
| | | android:layout_width="@dimen/dp_18" |
| | | android:layout_height="@dimen/dp_18" |
| | | android:layout_marginTop="@dimen/dp_9" |
| | | android:layout_marginEnd="@dimen/dp_24" |
| | | android:src="@drawable/add" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/home_page_station_ll" |
| | | android:layout_width="0dp" |
| | | android:layout_height="@dimen/dp_56" |
| | | android:layout_marginTop="@dimen/dp_26" |
| | | android:layout_marginEnd="@dimen/dp_16" |
| | | android:orientation="horizontal" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="@+id/home_page_title_tv" |
| | | app:layout_constraintTop_toBottomOf="@+id/home_page_title_tv"> |
| | | <!--全部--> |
| | | <include |
| | | android:id="@+id/home_page_station_all_ic" |
| | | layout="@layout/item_station" /> |
| | | |
| | | <View |
| | | android:layout_width="15.5dp" |
| | | android:layout_height="match_parent" /> |
| | | <!--故障--> |
| | | <include |
| | | android:id="@+id/home_page_station_fault_ic" |
| | | layout="@layout/item_station" /> |
| | | |
| | | <View |
| | | android:layout_width="16dp" |
| | | android:layout_height="match_parent" /> |
| | | <!--离线--> |
| | | <include |
| | | android:id="@+id/home_page_station_offline_ic" |
| | | layout="@layout/item_station" /> |
| | | |
| | | <View |
| | | android:layout_width="15.5dp" |
| | | android:layout_height="match_parent" /> |
| | | <!--待接入--> |
| | | <include |
| | | android:id="@+id/home_page_station_connected_ic" |
| | | layout="@layout/item_station" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <ScrollView |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | android:layout_marginTop="@dimen/dp_30" |
| | | android:layout_marginStart="@dimen/dp_16" |
| | | android:layout_marginEnd="@dimen/dp_16" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/test" /> |
| | | app:layout_constraintTop_toBottomOf="@+id/home_page_station_ll"> |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/home_page_station_info_cl" |
| | | android:layout_width="0dp" |
| | | android:layout_height="312dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent"> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/home_page_station_info_rl1" |
| | | android:layout_width="0dp" |
| | | android:layout_height="146dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent"> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/home_page_station_info_rl1_f" |
| | | android:layout_width="102dp" |
| | | android:layout_height="102dp" |
| | | android:layout_marginTop="@dimen/dp_22" |
| | | android:background="@drawable/disc"> |
| | | |
| | | <TextView |
| | | android:id="@+id/home_page_station_info_rl1_f_text1_tv" |
| | | android:layout_width="62dp" |
| | | android:layout_height="31.5dp" |
| | | android:layout_centerVertical="true" |
| | | android:gravity="end|center_vertical" |
| | | android:text="88" |
| | | android:textSize="@dimen/text_26" |
| | | android:textStyle="bold" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/home_page_station_info_rl1_f_text2_tv" |
| | | android:layout_width="9dp" |
| | | android:layout_height="14.5dp" |
| | | android:layout_alignBottom="@+id/home_page_station_info_rl1_f_text1_tv" |
| | | android:layout_marginStart="2.5dp" |
| | | android:layout_marginBottom="4.5dp" |
| | | android:layout_toEndOf="@+id/home_page_station_info_rl1_f_text1_tv" |
| | | android:text="%" |
| | | android:textColor="@color/text_191919" |
| | | android:textSize="@dimen/text_12" /> |
| | | </RelativeLayout> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/home_page_station_info_rl1_text1_tv" |
| | | style="@style/Text20Style" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_24" |
| | | android:layout_marginStart="@dimen/dp_16" |
| | | android:layout_marginTop="@dimen/dp_21" |
| | | android:layout_toEndOf="@+id/home_page_station_info_rl1_f" |
| | | android:text="33333333" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/home_page_station_info_rl1_text2_tv" |
| | | style="@style/Text14Style" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_17" |
| | | android:layout_below="@+id/home_page_station_info_rl1_text1_tv" |
| | | android:layout_alignStart="@+id/home_page_station_info_rl1_text1_tv" |
| | | android:layout_marginTop="3dp" |
| | | android:text="kw.h" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/home_page_station_info_rl1_text3_tv" |
| | | style="@style/Text20Style" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_24" |
| | | android:layout_below="@+id/home_page_station_info_rl1_text2_tv" |
| | | android:layout_alignStart="@+id/home_page_station_info_rl1_text1_tv" |
| | | android:layout_marginTop="@dimen/dp_16" |
| | | android:text="33333" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/home_page_station_info_rl1_text4_tv" |
| | | style="@style/Text14Style" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_17" |
| | | android:layout_below="@+id/home_page_station_info_rl1_text3_tv" |
| | | android:layout_alignStart="@+id/home_page_station_info_rl1_text1_tv" |
| | | android:layout_marginTop="3dp" |
| | | android:text="kw.h" /> |
| | | |
| | | </RelativeLayout> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/home_page_station_info_rl2" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dp_166" |
| | | android:background="@drawable/bj_13_ffffff" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/home_page_station_info_rl1"> |
| | | |
| | | <ImageView |
| | | android:layout_width="25dp" |
| | | android:layout_height="22dp" |
| | | android:layout_marginStart="15.5dp" |
| | | android:layout_marginTop="10.5dp" |
| | | android:src="@drawable/info_1" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/home_page_station_info_rl1_title_tv" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="14.5dp" |
| | | android:layout_marginStart="@dimen/dp_47" |
| | | android:layout_marginTop="17dp" |
| | | android:text="Electricity /kw.h" |
| | | android:textColor="@color/text_191919" |
| | | android:textSize="@dimen/text_12" /> |
| | | |
| | | <include |
| | | android:id="@+id/home_page_station_info_rl2_day_ic" |
| | | layout="@layout/item_data" |
| | | android:layout_width="@dimen/dp_171" |
| | | android:layout_height="@dimen/dp_44" |
| | | android:layout_marginTop="47.5dp" /> |
| | | |
| | | <View |
| | | android:id="@+id/line1_v" |
| | | android:layout_width="0.5dp" |
| | | android:layout_height="37.5dp" |
| | | android:layout_marginTop="53dp" |
| | | android:layout_toEndOf="@+id/home_page_station_info_rl2_day_ic" |
| | | android:background="@color/text_E1E1E1" /> |
| | | |
| | | <include |
| | | android:id="@+id/home_page_station_info_rl2_mon_ic" |
| | | layout="@layout/item_data" |
| | | android:layout_width="@dimen/dp_171" |
| | | android:layout_height="@dimen/dp_44" |
| | | android:layout_marginTop="47.5dp" |
| | | android:layout_toEndOf="@+id/line1_v" /> |
| | | |
| | | <include |
| | | android:id="@+id/home_page_station_info_rl2_year_ic" |
| | | layout="@layout/item_data" |
| | | android:layout_width="@dimen/dp_171" |
| | | android:layout_height="@dimen/dp_44" |
| | | android:layout_marginTop="106dp" /> |
| | | |
| | | <View |
| | | android:id="@+id/line2_v" |
| | | android:layout_width="0.5dp" |
| | | android:layout_height="37.5dp" |
| | | android:layout_marginTop="109.5dp" |
| | | android:layout_toEndOf="@+id/home_page_station_info_rl2_year_ic" |
| | | android:background="@color/text_E1E1E1" /> |
| | | |
| | | <include |
| | | android:id="@+id/home_page_station_info_rl2_cumulative_ic" |
| | | layout="@layout/item_data" |
| | | android:layout_width="@dimen/dp_171" |
| | | android:layout_height="@dimen/dp_44" |
| | | android:layout_marginTop="106dp" |
| | | android:layout_toEndOf="@+id/line2_v" /> |
| | | |
| | | </RelativeLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/test1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="点击测试1" |
| | | android:textSize="@dimen/text_30" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/home_page_station_info_cl" /> |
| | | |
| | | <com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartView |
| | | android:id="@+id/AAChartView1" |
| | | android:layout_width="0dp" |
| | | android:layout_height="300dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/test1" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/test2" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="点击测试2" |
| | | android:textSize="@dimen/text_30" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/AAChartView1" /> |
| | | |
| | | <com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartView |
| | | android:id="@+id/AAChartView2" |
| | | android:layout_width="0dp" |
| | | android:layout_height="300dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/test2" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/test3" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="点击测试3" |
| | | android:textSize="@dimen/text_30" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/AAChartView2" /> |
| | | |
| | | <com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartView |
| | | android:id="@+id/AAChartView3" |
| | | android:layout_width="0dp" |
| | | android:layout_height="300dp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/test3" /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | |
| | | </ScrollView> |
| | | |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="@dimen/dp_171" |
| | | android:layout_height="@dimen/dp_44"> |
| | | |
| | | <TextView |
| | | android:id="@+id/data_tv" |
| | | style="@style/Text20Style" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_24" |
| | | android:text="33333" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/data_type_tv" |
| | | style="@style/Text14Style" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_17" |
| | | android:layout_marginTop="3dp" |
| | | android:text="kw.h" |
| | | app:layout_constraintEnd_toEndOf="@+id/data_tv" |
| | | app:layout_constraintStart_toStartOf="@+id/data_tv" |
| | | app:layout_constraintTop_toBottomOf="@+id/data_tv" /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:id="@+id/station_status_cl" |
| | | android:layout_width="@dimen/dp_74" |
| | | android:layout_height="@dimen/dp_56" |
| | | android:background="@drawable/station_status_no_ffffff"> |
| | | |
| | | <TextView |
| | | android:id="@+id/station_status_tv" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_25" |
| | | android:layout_marginTop="7dp" |
| | | android:text="99" |
| | | android:textColor="@color/text_90000000" |
| | | android:textSize="@dimen/text_14" |
| | | android:textStyle="bold" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/station_status_number_tv" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_17" |
| | | android:layout_marginTop="1dp" |
| | | android:text="state" |
| | | android:textColor="@color/text_40000000" |
| | | android:textSize="@dimen/text_14" |
| | | app:layout_constraintEnd_toEndOf="@+id/station_status_tv" |
| | | app:layout_constraintStart_toStartOf="@+id/station_status_tv" |
| | | app:layout_constraintTop_toBottomOf="@+id/station_status_tv" /> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | <item name="android:background">@color/black_overlay</item> |
| | | <item name="android:buttonBarStyle">?android:attr/buttonBarStyle</item> |
| | | </style> |
| | | |
| | | <style name="NoAnimationTheme" parent="Theme.AppCompat.Light.NoActionBar"> |
| | | <item name="android:windowAnimationStyle">@null</item> |
| | | </style> |
| | | <!-- 自定义字体样式 页面一级标题--> |
| | | <style name="Text20Style"> |
| | | <item name="android:textSize">@dimen/text_20</item> |
| | | <item name="android:textStyle">bold</item> |
| | | <item name="android:textColor">@color/text_90000000</item> |
| | | |
| | | </style> |
| | | <!-- 自定义字体样式 内容一级标题--> |
| | | <style name="Text21Style"> |
| | | <item name="android:textSize">@dimen/text_21</item> |
| | | <item name="android:textStyle">bold</item> |
| | | <item name="android:textColor">@color/text_90000000</item> |
| | | |
| | | </style> |
| | | <!-- 自定义字体样式 --> |
| | | <style name="Text14Style"> |
| | | <item name="android:textSize">@dimen/text_14</item> |
| | | <item name="android:textColor">@color/text_40000000</item> |
| | | </style> |
| | | |
| | | |
| | | </resources> |