Question for the group.
I've been trying to implement a chart with charts.css and have so far been unsuccessful. If I copy Anjar's code into a tiddler, I get a good result. But when I try to implement a chart with values based on fields and filters with the following code:
\define st() <$text text='"--size:$(final)$;"'/>
\define status1()
<$vars total={{{ [tag[Railroads]count[]] }}}
value={{{ [tag[Railroads]summaryinfo[yes]count[]] }}}>
<$vars final={{{ [<value>divide<total>fixed[2]] }}}>
<<st>>
</$vars>
</$vars>
\end
\define status2()
<$vars total={{{ [tag[Railroads]count[]] }}}
value={{{ [tag[Railroads]psearch[yes]count[]] }}}>
<$vars final={{{ [<value>divide<total>fixed[2]] }}}>
<<st>>
</$vars>
</$vars>
\end
\define status3()
<$vars total={{{ [tag[Railroads]count[]] }}}
value={{{ [tag[Railroads]fsearch[yes]count[]] }}}>
<$vars final={{{ [<value>divide<total>fixed[2]] }}}>
<<st>>
</$vars>
</$vars>
\end
\define status4()
<$vars total={{{ [tag[Railroads]count[]] }}}
value={{{ [tag[Railroads]routemap[yes]count[]] }}}>
<$vars final={{{ [<value>divide<total>fixed[2]] }}}>
<<st>>
</$vars>
</$vars>
\end
\define status5()
<$vars total={{{ [tag[Railroads]count[]] }}}
value={{{ [tag[Railroads]textdraft[yes]count[]] }}}>
<$vars final={{{ [<value>divide<total>fixed[2]] }}}>
<<st>>
</$vars>
</$vars>
\end
\define status6()
<$vars total={{{ [tag[Railroads]count[]] }}}
value={{{ [tag[Railroads]textfinal[yes]count[]] }}}>
<$vars final={{{ [<value>divide<total>fixed[2]] }}}>
<<st>>
</$vars>
</$vars>
\end
\define researchstatus()
<table id="bar-example-10" class="charts-css bar show-labels show-heading show-4-secondary-axes">
<caption>Trial Research Status Chart</caption>
<tbody>
<tr>
<th scope="row">summaryinfo:</th>
<td style=<<status1>>> <<status1>></td>
</tr>
<tr>
<th scope="row">psearch:</th>
<td style=<<status2>>> <<status2>></td>
</tr>
<tr>
<th scope="row">fsearch:</th>
<td style=<<status3>>> <<status3>></td>
</tr>
<tr>
<th scope="row">routemap:</th>
<td style=<<status4>>> <<status4>></td>
</tr>
<tr>
<th scope="row">textdraft:</th>
<td style=<<status5>>> <<status5>></td>
</tr>
<tr>
<th scope="row">textfinal:</th>
<td style=<<status6>>> <<status6>></td>
</tr>
</tbody>
</table>
\end
width: 1000px;
margin: 0 auto;
}
</style>
<<researchstatus>>
The following graph results.
I cannot get the bar width to be proportional to the values I'm giving it. The bars are always the full width of the chart. The only way I can make it work is to have the values hard coded into the macrocall as Anjar did with his. I tried passing variables into the macrocall, but I haven't been successful with that either. I'm still confused at times by how to pass variables to macros.
Up to this point, I've been using the barchart plugin (
https://ooktech.com/TiddlyWiki/BarChart/), but I can't pass numbers to it. It is setup only to use filters and does the count on titles and not field values.
Any help would be greatly appreciated.