<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_related_chart(self, data, work, output_dir):
 """Generates and writes to a file in `output_dir` the data used to display a grouped bar chart. This data gives, for each "maybe" work, the percentage of it that is shared with `work`, and the percentage of `work` that is shared with the "maybe" work. :param data: data to derive the chart data from :type data: `pandas.DataFrame` :param works: work to show related data for :type works: `str` :param output_dir: directory to output data file to :type output_dir: `str` """

        chart_data = data[work].dropna().sort_values(by=SHARED_RELATED_WORK,
                                                     ascending=False)
        csv_path = os.path.join(output_dir, 'related_{}.csv'.format(work))
        chart_data.to_csv(csv_path)