Skip to content

Commit

Permalink
Merge pull request codinguser#338 from aint/stacked_bar_chart
Browse files Browse the repository at this point in the history
Improved stacked bar chart
Display expenses sub accounts as stacked bars
Workaround to bypass legend restrictions
Added account type spinner
Fixed x-axis calculating
Use the same color for the same account in different bars
Show stack label on chart value selected
Code documentation and refactoring
Fix for animation
Use account color in the bar chart
Fix for empty bars
  • Loading branch information
codinguser committed Jun 2, 2015
2 parents b6643e8 + 612096e commit a2ce02d
Show file tree
Hide file tree
Showing 13 changed files with 252 additions and 128 deletions.
298 changes: 181 additions & 117 deletions app/src/main/java/org/gnucash/android/ui/chart/BarChartActivity.java

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions app/src/main/res/layout/activity_bar_chart.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
Copyright (c) 2015 Oleksandr Tyshkovets <olexandr.tyshkovets@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout android:id="@+id/bar_chart"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1" />

<Spinner android:id="@+id/chart_data_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center">

<TextView android:id="@+id/selected_chart_slice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" />

</LinearLayout>

</LinearLayout>
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ No user-identifiable information will be collected as part of this process!</str
<string name="header_report_settings">Reports</string>
<string name="label_report_currency">Select currency</string>
<string name="title_use_account_color">Account color in reports</string>
<string name="summary_use_account_color">Use account color in the pie chart</string>
<string name="summary_use_account_color">Use account color in the bar/pie chart</string>
<string name="label_confirm_passcode">Please confirm your passcode</string>
<string name="label_new_passcode">Enter your new passcode</string>
<string name="label_old_passcode">Enter your old passcode</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ No user-identifiable information will be collected as part of this process!
<string name="header_report_settings">Reports</string>
<string name="label_report_currency">Select currency</string>
<string name="title_use_account_color">Account color in reports</string>
<string name="summary_use_account_color">Use account color in the pie chart</string>
<string name="summary_use_account_color">Use account color in the bar/pie chart</string>
<string name="label_confirm_passcode">Please confirm your passcode</string>
<string name="label_new_passcode">Enter your new passcode</string>
<string name="label_old_passcode">Enter your old passcode</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es-rMX/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ No user-identifiable information will be collected as part of this process!
<string name="header_report_settings">Reports</string>
<string name="label_report_currency">Select currency</string>
<string name="title_use_account_color">Account color in reports</string>
<string name="summary_use_account_color">Use account color in the pie chart</string>
<string name="summary_use_account_color">Use account color in the bar/pie chart</string>
<string name="label_confirm_passcode">Please confirm your passcode</string>
<string name="label_new_passcode">Enter your new passcode</string>
<string name="label_old_passcode">Enter your old passcode</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ Este proceso solo recoge informaci&#243;n que no permite identificar al usuario<
<string name="header_report_settings">Reports</string>
<string name="label_report_currency">Select currency</string>
<string name="title_use_account_color">Account color in reports</string>
<string name="summary_use_account_color">Use account color in the pie chart</string>
<string name="summary_use_account_color">Use account color in the bar/pie chart</string>
<string name="label_confirm_passcode">Confirme su contrase&#241;a</string>
<string name="label_new_passcode">Enter your new passcode</string>
<string name="label_old_passcode">Enter your old passcode</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ Aucune information permettant d\'identifier l\'utilisateur ne sera recueillis da
<string name="header_report_settings">Rapports</string>
<string name="label_report_currency">Sélectionnez la monnaie</string>
<string name="title_use_account_color">Couleur du compte dans les rapports</string>
<string name="summary_use_account_color">utiliser la couleur du compte dans le diagramme circulaire</string>
<string name="summary_use_account_color">utiliser la couleur du compte dans le diagramme bandes/circulaire</string>
<string name="label_confirm_passcode">Veuillez confirmer vorte code</string>
<string name="label_new_passcode">Entrez votre nouveau code</string>
<string name="label_old_passcode">Entrez votre ancien mot de passe</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ No user-identifiable information will be collected as part of this process!
<string name="header_report_settings">Reports</string>
<string name="label_report_currency">Select currency</string>
<string name="title_use_account_color">Account color in reports</string>
<string name="summary_use_account_color">Use account color in the pie chart</string>
<string name="summary_use_account_color">Use account color in the bar/pie chart</string>
<string name="label_confirm_passcode">Please confirm your passcode</string>
<string name="label_new_passcode">Enter your new passcode</string>
<string name="label_old_passcode">Enter your old passcode</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ No user-identifiable information will be collected as part of this process!
<string name="header_report_settings">Reports</string>
<string name="label_report_currency">Select currency</string>
<string name="title_use_account_color">Account color in reports</string>
<string name="summary_use_account_color">Use account color in the pie chart</string>
<string name="summary_use_account_color">Use account color in the bar/pie chart</string>
<string name="label_confirm_passcode">Please confirm your passcode</string>
<string name="label_new_passcode">Enter your new passcode</string>
<string name="label_old_passcode">Enter your old passcode</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ No user-identifiable information will be collected as part of this process!
<string name="header_report_settings">Reports</string>
<string name="label_report_currency">Select currency</string>
<string name="title_use_account_color">Account color in reports</string>
<string name="summary_use_account_color">Use account color in the pie chart</string>
<string name="summary_use_account_color">Use account color in the bar/pie chart</string>
<string name="label_confirm_passcode">Please confirm your passcode</string>
<string name="label_new_passcode">Enter your new passcode</string>
<string name="label_old_passcode">Enter your old passcode</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ Nenhuma informação de identificação do usuário será coletada neste proces
<string name="header_report_settings">Relatórios</string>
<string name="label_report_currency">Selecionar moeda</string>
<string name="title_use_account_color">Cor de contas nos relatórios</string>
<string name="summary_use_account_color">Utilizar cor de contas no gráfico de pizza</string>
<string name="summary_use_account_color">Utilizar cor de contas no gráfico de barras/pizza</string>
<string name="nav_menu_scheduled_backups">Backups agendados</string>
<string name="title_scheduled_exports">Exportações agendadas</string>
<string name="label_no_scheduled_exports_to_display">Sem exportações agendadas para mostrar</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@
</plurals>
<string name="title_enable_crashlytics">启用崩溃日志</string>
<string name="msg_enable_crashlytics">Enable to send information about malfunctions to the developers for improvement (recommended).
No user-identifiable information will be collected as part of this process!</string>
No user-identifiable information will be collected as part of this process!
</string>
<string name="label_export_format">导出格式</string>
<string name="toast_backup_folder_not_found">找不到备份目录,请确认SD卡正常。</string>
<string name="label_old_passcode">先输入现在的密码</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@
<string name="title_report_prefs">Report Preferences</string>
<string name="label_report_currency">Select currency</string>
<string name="title_use_account_color">Account color in reports</string>
<string name="summary_use_account_color">Use account color in the pie chart</string>
<string name="summary_use_account_color">Use account color in the bar/pie chart</string>
<string name="header_report_settings">Reports</string>
<string name="menu_order_by_size">Order by size</string>
<string name="menu_toggle_legend">Toggle legend</string>
Expand Down

0 comments on commit a2ce02d

Please sign in to comment.