1
$\begingroup$

I am trying to create a financial dashboard using Mathematica. I am having trouble formatting the axes ticks to show whole numbers. Further, when I hover over one of the chart elements, it is displayed in scientific notation. I have attached the code and an image.

Manipulate[
  sql = StringJoin[
    "select Right(Period,2) as [Period], SUM(Revenue) as [Revenue] ", 
    " from PRSummaryCMF where Month >=  ", ToString[a], 
    " and Year =  ", ToString[b], " group by Period order by Period"];
  n = SQLExecute[conn, sql];
  BarChart[n[[All, 2]], 
    ChartLabels -> {n[[All, 1]]}, 
    ChartStyle -> "Pastel" , 
    BarSpacing -> Automatic], 
  {{b, 2010, "Year"}, {2010, 2011, 2012, 2013}, ControlType -> Setter}, 
  {{a, "01", "Period"}, 
    {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"}, 
    ControlType -> Setter,  Appearance -> "Labeled"},
  ContentSize -> 500]

Output Image

$\endgroup$
1

1 Answer 1

2
$\begingroup$

My attempt:

n = Table[{x , x  RandomReal[] 10^6}, {x, 1, 12}];
BarChart[n[[All, 2]],
 LabelingFunction -> (AccountingForm[#] &),
 Frame -> True,
 FrameTicks -> {{Table[{x, AccountingForm[x], {.01, 0}}, {x, 10^5, 
      10^7, 10^6}], None}, {None, None}},
 ChartLabels -> Placed[n[[All, 1]], {{0.5, 0}, {0, 2}}] ,
 ChartStyle -> "Pastel",
 BarSpacing -> Automatic]

a bar chart

But I think it should be easier than this somehow…

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.